]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Add a new flag DMF_MERGE_IS_OPTIONAL to struct mapped_device to indicate
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 25 Jul 2011 00:49:54 +0000 (10:49 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 25 Jul 2011 00:49:54 +0000 (10:49 +1000)
commit50e89293c1e9f20d0db3d231c192ee35900cdcd5
treebbd17aa9691d05a2a13726c7d6998d5caf7e1e48
parent93a309c04876a3b0965d17f0bc13809200977573
Add a new flag DMF_MERGE_IS_OPTIONAL to struct mapped_device to indicate
whether the device can accept bios larger than the size its merge
function returns.  When set, use this to send large bios to snapshots
which can split them if necessary.  Snapshot I/O may be significantly
fragmented and this approach seems to improve peformance.

Before the patch, dm_set_device_limits restricted bio size to page size
if the underlying device had a merge function and the target didn't
provide a merge function.  After the patch, dm_set_device_limits
restricts bio size to page size if the underlying device has a merge
function, doesn't have DMF_MERGE_IS_OPTIONAL flag and the target doesn't
provide a merge function.

The snapshot target can't provide a merge function because when the merge
function is called, it is impossible to determine where the bio will be
remapped.  Previously this led us to impose a 4k limit, which we can
now remove if the snapshot store is located on a device without a merge
function.  Together with another patch for optimizing full chunk writes,
it improves performance from 29MB/s to 40MB/s when writing to the
filesystem on snapshot store.

If the snapshot store is placed on a non-dm device with a merge function
(such as md-raid), device mapper still limits all bios to page size.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-table.c
drivers/md/dm.c
drivers/md/dm.h