This is the updated patch, as we discussed on irc.
Mikulas
---
dm: Introduce DMF_MERGE_IS_OPTIONAL flag
DMF_MERGE_IS_OPTIONAL flag is set in "struct mapped_device". It means that
bvec_merge_fn function is only a hint and can be ignored for performance
reasons (for example, when we need to write to the whole chunk in snapshots).
DMF_MERGE_IS_OPTIONAL is set if: for every underlying device, the device
either doesn't have a bvec_merge_fn function or has a bvec_merge_fn function
and has DMF_MERGE_IS_OPTIONAL set.
We change logic in dm_set_device_limits:
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).
This patch removes 4k limit for snapshots if the snapshot store is located
on a device without merge function. Thus (together with a previous patch for
optimizing full chunk write), 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 device with merge function (such as
md-raid), device mapper still limits all bios to page size. There is no easy
workaround possible.
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
06-23-2011, 01:14 AM
Alasdair G Kergon
dm: Introduce DMF_MERGE_IS_OPTIONAL flag
On Wed, Jun 22, 2011 at 07:57:49PM -0400, Mikulas Patocka wrote:
> dm: Introduce DMF_MERGE_IS_OPTIONAL flag
To summarise - and, again, we need some comments in the code:
If the new flag is set, it means that the device is capable of accepting
and processing correctly bios larger than the size the merge function
returns. Or in other words, it means that the device is able to split
a bio itself if it is too big.
There are cases today where we are limited to submitting tiny bios as a
precaution against an underlying device being unable to split them if
it needs to. The patch reduces the number of such cases.
Alasdair
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel