Commit Graph

2772 Commits

Author SHA1 Message Date
Brian Behlendorf 0b03d82241 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2009-11-20 16:21:28 -08:00
Brian Behlendorf c14a8b2272 Ensure *.order and *.markers build products are removed by distclean rule. 2009-11-20 16:17:16 -08:00
Brian Behlendorf fb1b00e9f4 Linux ZVOL implementation; kernel-side changes
At last a useful user space interface for the Linux ZFS port arrives.
With the addition of the ZVOL real ZFS based block devices are available
and can be compared head to head with Linux's MD and LVM block drivers.
The Linux ZVOL has not yet had any performance work done but from a user
perspective it should be functionally complete and behave like any other
Linux block device.

The ZVOL has so far been tested using zconfig.sh on the following x86_64
based platforms: FC11, CHAOS4, RHEL5, RHEL6, and SLES11.  However, more
testing is required to ensure everything is working as designed.

What follows in a somewhat detailed list of changes includes in this
commit to make ZVOL's possible.  A few other issues were addressed in
the context of these changes which will also be mentioned.

* Added module/zfs/zvol.c which is based off the original Solaris ZVOL
implementation but rewritten to intergrate with the Linux block device
APIs.  The basic design remains the similar in Linux with the major
change being request processing.  Request processing is handled by
registering a request function which the elevator calls once all request
merges is finished and the elevator unplugs.  This function is called
under a spin lock and the request structure is passed to the block driver
to be queued for IO.  The elevator must be notified asyncronously once
the request completes or fails with an error.  This allows us the block
driver a chance to handle many request concurrently.  For the ZVOL we
maintain a taskq with a service thread per core.  As requests are delivered
by the elevator each request is dispatched to the taskq.  The task queue
handles each request with a write or read helper function which basically
copies the request data in to our out of the DMU object.  Writes single
completion as soon as the DMU has the data unless they are marked sync.
Reads are all handled syncronously however the elevator will merge many
small reads in to a large read before it submitting the request.

* Cachine is worth specifically mentioning.  Because both the Linux VFS
and the ZFS ARC both want to fully manage the cache we unfortunately
end up with two caches.  This means our memory foot print is larger
than otherwise expected, and it means we have an extra copy between
the caches, but it does not impact correctness.  All syncs are barrior
requests I believe are handled correctly.  Longer term there is lots of
room for improvement here but it will require fairly extensive changes
to either the Linux VFS and VM layer, or additional DMU interfaces to
handle managing buffer not directly allocated by the ARC.

* Added module/zfs/include/sys/blkdev.h which contains all the Linux
compatibility foo which is required to handle changes in the Linux block
APIs from 2.6.18 thru 2.6.31 based kernels.

* The dmu_{read,write}_uio interfaces which don't make sense on Linux
have been modified to dmu_{read,write}_req functions which consume the
standard Linux IO request structure.  Their function fundamentally
remains the same so this happily worked out pretty cleanly.

* The /dev/zfs character device is no longer created through the half
implemented Solaris driver DDI interfaces.  It is now simply created
with it's own major number as a Linux misc device which greatly simplifies
everything.  It is only capable of handling ioctls() but this fits nicely
because that's all it ever has to do.  The ZVOL devices unlike in Solaris
do not leverage the same major number as /dev/zfs but instead register
their own major.  Because only one major is allocated and space is reserved
for 16 partitions per-device there is a limit of 16384 concurrent ZVOL
devices.  By using multiple majors like the scsi driver this limit could
be addressed if it becomes a problem.

* The {spa,zfs,zvol}_busy() functions have all be removed because they
are not required on a Linux system.  Under Linux the registered module
exit function will not be called while the are still references to the
module.  Once the exit function is called however it must succeed or
block, it may not fail so returning an error on module unload makes to
sense under Linux.

* With the addition of ZVOL support all the HAVE_ZVOL defines were removed
for obvious reasons.  However, the HAVE_ZPL defines have been relocated
in to the linux-{kernel,user}-disk topic branches and must remain until
the ZPL is implemented.
2009-11-20 11:06:59 -08:00
Brian Behlendorf 49fdb13bc8 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2009-11-20 10:30:50 -08:00
Brian Behlendorf cac1bc41dc Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2009-11-20 10:29:49 -08:00
Brian Behlendorf 77c347db31 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2009-11-20 10:29:48 -08:00
Brian Behlendorf 9c8765a219 Merge commit 'refs/top-bases/gcc-branch' into gcc-branch 2009-11-20 10:29:48 -08:00
Brian Behlendorf 0f315a58bb Merge branch 'gcc-uninit' into refs/top-bases/gcc-branch 2009-11-20 10:29:47 -08:00
Brian Behlendorf 23304dc828 Add 16 drive promise JBOD zpool configs for small test setup. 2009-11-20 10:12:41 -08:00
Brian Behlendorf 6fabeffd3b Additional ZVOL compatibility autoconf checks and zconfig ZVOL sanity test. 2009-11-20 10:04:56 -08:00
Brian Behlendorf 3191b962f6 Prevent gcc uninit compiler warning in zfs_range_unlock_reader(). 2009-11-20 09:59:58 -08:00
Brian Behlendorf 31f893c17c Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2009-11-16 10:37:15 -08:00
Brian Behlendorf 915205a6e8 Add autoconf checks for zvol integration. 2009-11-16 10:31:10 -08:00
Brian Behlendorf 50e6c144e6 Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk 2009-11-15 16:28:08 -08:00
Brian Behlendorf 844280cb2c Merge branch 'feature-branch' into refs/top-bases/zfs-branch 2009-11-15 16:27:02 -08:00
Brian Behlendorf d00a0ea8a0 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2009-11-15 16:27:02 -08:00
Brian Behlendorf 368cfaefdb Merge commit 'refs/top-bases/feature-branch' into feature-branch 2009-11-15 16:27:00 -08:00
Brian Behlendorf f056747e61 Merge branch 'feature-pthreads' into refs/top-bases/feature-branch 2009-11-15 16:27:00 -08:00
Brian Behlendorf 71ccaccb2b Merge commit 'refs/top-bases/feature-pthreads' into feature-pthreads 2009-11-15 16:27:00 -08:00
Brian Behlendorf 475e214ce1 Merge commit 'refs/top-bases/feature-commit-cb' into feature-commit-cb 2009-11-15 16:27:00 -08:00
Brian Behlendorf 8c5797df77 Merge branch 'feature-zap-cursor-to-key' into refs/top-bases/feature-branch 2009-11-15 16:26:58 -08:00
Brian Behlendorf 65f6d4b712 Merge commit 'refs/top-bases/feature-zap-cursor-to-key' into feature-zap-cursor-to-key 2009-11-15 16:26:58 -08:00
Brian Behlendorf c53763d2e7 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2009-11-15 16:26:55 -08:00
Brian Behlendorf 7188068143 Merge commit 'refs/top-bases/fix-branch' into fix-branch 2009-11-15 16:26:54 -08:00
Brian Behlendorf ca3aba32bb Merge branch 'fix-acl' into refs/top-bases/fix-branch 2009-11-15 16:26:54 -08:00
Brian Behlendorf d9ff087661 Merge branch 'fix-deadcode' into refs/top-bases/fix-branch 2009-11-15 16:26:53 -08:00
Brian Behlendorf 2985a9c531 Merge commit 'refs/top-bases/fix-acl' into fix-acl 2009-11-15 16:26:53 -08:00
Brian Behlendorf f8e0e1c54d Merge commit 'refs/top-bases/fix-deadcode' into fix-deadcode 2009-11-15 16:26:52 -08:00
Brian Behlendorf 1e60ba892b Merge branch 'fix-strncat' into refs/top-bases/fix-branch 2009-11-15 16:26:51 -08:00
Brian Behlendorf 8489fdd251 Merge commit 'refs/top-bases/fix-strncat' into fix-strncat 2009-11-15 16:26:51 -08:00
Brian Behlendorf 7d49468141 Merge branch 'fix-list' into refs/top-bases/fix-branch 2009-11-15 16:26:50 -08:00
Brian Behlendorf a81f45b3ee Merge commit 'refs/top-bases/fix-list' into fix-list 2009-11-15 16:26:50 -08:00
Brian Behlendorf a41e8c431f Merge branch 'fix-taskq' into refs/top-bases/fix-branch 2009-11-15 16:26:49 -08:00
Brian Behlendorf e530326e8f Merge commit 'refs/top-bases/fix-taskq' into fix-taskq 2009-11-15 16:26:48 -08:00
Brian Behlendorf 2c76b1eae5 Merge branch 'fix-stack' into refs/top-bases/fix-branch 2009-11-15 16:26:47 -08:00
Brian Behlendorf b57e406dd6 Merge commit 'refs/top-bases/fix-stack' into fix-stack 2009-11-15 16:26:47 -08:00
Brian Behlendorf e1658bc3c0 Merge branch 'fix-rwlocks' into refs/top-bases/fix-branch 2009-11-15 16:26:46 -08:00
Brian Behlendorf 45b0c5f49c Merge commit 'refs/top-bases/fix-rwlocks' into fix-rwlocks 2009-11-15 16:26:45 -08:00
Brian Behlendorf 756ced6a4e Merge branch 'fix-no-zmod' into refs/top-bases/fix-branch 2009-11-15 16:26:44 -08:00
Brian Behlendorf 12ed77ee86 Merge commit 'refs/top-bases/fix-no-zmod' into fix-no-zmod 2009-11-15 16:26:44 -08:00
Brian Behlendorf 08b581e77b Merge branch 'fix-newlines' into refs/top-bases/fix-branch 2009-11-15 16:26:43 -08:00
Brian Behlendorf df9f0836db Merge commit 'refs/top-bases/fix-newlines' into fix-newlines 2009-11-15 16:26:43 -08:00
Brian Behlendorf 437a6a6f61 Merge branch 'fix-get-configs' into refs/top-bases/fix-branch 2009-11-15 16:26:42 -08:00
Brian Behlendorf e663d428a4 Merge commit 'refs/top-bases/fix-get-configs' into fix-get-configs 2009-11-15 16:26:42 -08:00
Brian Behlendorf 3206618a84 Merge branch 'fix-evict-dbufs' into refs/top-bases/fix-branch 2009-11-15 16:26:41 -08:00
Brian Behlendorf dc5f610e90 Merge branch 'fix-dsl_pool_t' into refs/top-bases/fix-branch 2009-11-15 16:26:40 -08:00
Brian Behlendorf 584ad2b364 Merge commit 'refs/top-bases/fix-evict-dbufs' into fix-evict-dbufs 2009-11-15 16:26:40 -08:00
Brian Behlendorf 8d0c0b0782 Merge commit 'refs/top-bases/fix-dsl_pool_t' into fix-dsl_pool_t 2009-11-15 16:26:39 -08:00
Brian Behlendorf 0b57c83685 Merge branch 'fix-dnode-cons' into refs/top-bases/fix-branch 2009-11-15 16:26:38 -08:00
Brian Behlendorf b3c507f429 Merge commit 'refs/top-bases/fix-dnode-cons' into fix-dnode-cons 2009-11-15 16:26:38 -08:00