OpenZFS Channel programs
Upcoming SlideShare
Loading in...5

OpenZFS Channel programs



Talk by Chris Siden & Max Grossman at the 2013 OpenZFS Developer Summit

Talk by Chris Siden & Max Grossman at the 2013 OpenZFS Developer Summit



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds


Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    OpenZFS Channel programs OpenZFS Channel programs Presentation Transcript

    • ZFS Channel Programs Proposed Project
    • Background: Administrative Ops & Synctasks ● ZFS administrative operations are done transactionally as part of “synctasks”. Examples: ● zfs create ● zfs snapshot ● zfs set ● ‘zfs’ command sends ioctl to kernel ● Kernel queues operation’s synctask for execution ● synctasks are processed at the end of each txg in syncing context (holds config lock for write) ● User must wait for txg to complete
    • What are the problems? ● The time between txgs can be 10+ seconds. a. When doing consecutive operations each one blocks for 10+ seconds. b. Example: Delphix stores VMs on ZFS and keeps metadata in ZFS properties, simple operations like “create VM” take 30+ seconds waiting for synctasks
    • What are the problems? ● Only transactionally consistent within synctask. a. Forces logic into user space that could be more efficiently/correctly implemented in the kernel b. Example: zfs destroy -r gathers the list of snapshots to destroy in open context from userland. Also destroy of snapshots and destroy of filesystem are separate transactions.
    • What are the problems? ● Encourages more and more complicated synctasks in the kernel for correct behavior ● zfs destroy -p ● zfs rollback -p ● zfs snapshot <snap>,<snap>,... ● zfs snapshot (unless property is set)
    • Solution: ZFS Channel Programs ● Send a stream of instructions into the kernel for execution by ZFS in syncing context. ● Being in syncing context guarantees atomicity, consistent state changes, single-TXG execution. ● Enables rapid development of new “sync tasks” from existing intrinsics.
    • Sample Channel Program zfs destroy -r for snap in zfs.snapshots_of(target) zfs.destroy(snap) zfs.destroy(target)
    • Plan of Action Refactor existing sync task code to unify shared execution paths. Add Lua interpreter to kernel, implement ZFS intrinsics (destroy, snapshot, etc) as extensions to the Lua language that call into refactored sync tasks. Add ZFS Lua iterators, e.g. children(fs), snapshots (fs), etc.