aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2011-08-02 12:32:04 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-04-04 17:20:51 +0100
commit104acdc96c2a5276ac8e1604f9c6cedef7552b42 (patch)
tree053516cd249a6d0e9b41b1e9431d19c70cdaf69f /drivers/md/dm-table.c
parentdb79d5e31204bf77067462ce881b1af30d20bd01 (diff)
downloadkernel_samsung_smdk4412-104acdc96c2a5276ac8e1604f9c6cedef7552b42.zip
kernel_samsung_smdk4412-104acdc96c2a5276ac8e1604f9c6cedef7552b42.tar.gz
kernel_samsung_smdk4412-104acdc96c2a5276ac8e1604f9c6cedef7552b42.tar.bz2
dm: ignore merge_bvec for snapshots when safe
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>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index ebdae6e..c8c0783 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -539,8 +539,7 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
* If not we'll force DM to use PAGE_SIZE or
* smaller I/O, just to be safe.
*/
-
- if (q->merge_bvec_fn && !ti->type->merge)
+ if (dm_queue_merge_is_compulsory(q) && !ti->type->merge)
blk_limits_max_hw_sectors(limits,
(unsigned int) (PAGE_SIZE >> 9));
return 0;