mbox series

[0/2] dm log writes: Add support for filter bios based on its type

Message ID 20190619080312.11549-1-wqu@suse.com (mailing list archive)
Headers show
Series dm log writes: Add support for filter bios based on its type | expand

Message

Qu Wenruo June 19, 2019, 8:03 a.m. UTC
Current dm-log-writes will record all bios, no matter if the bios is
METADATA (normally what we care) or is DATA (normally we cares less for
the log-replay context).

This causes a lot of extra space required for log device. E.g write 10M,
sync, overwrite that 10M file, this would cause over 20M for log device
just for the data.

This patchset introduces two way to specify the dump type:
- dump_type=%s optional option for constructor
  The default dump_type is ALL, thus no behavior change.

- dump_type=%s message type to change type on the fly

Also to cooperate the new dump_type= option, always output the dump_type
for STATUSTYPE_TABLE.

A common use case would be:
 # dmsetup create log --table 0 $(blockdev --getsz $dev) log-writes $dev $log_dev
 # mkfs.btrfs -f /dev/mapper/log
 # dmsetup suspend log
 # dmsetup message log 0 dump_type=METADATA|FUA|FLUSH|DISCARD|MARK
 # dmsetup resume log
 # mount /dev/mapper/log <mnt>
 # <do some work load>
 # umount <mnt>
 # dmsetup remove log
 # <replay>

Now the log device will not record data writes, thus hugely reduce the
space requirement for log device, allowing more operations to be down
before hitting the space limit.

Currently btrfs check doesn't check data checksum by default, thus even
we have wrong data on-disk, we should be fine checking the metadata.

I'm not 100% sure if this applies to other filesystems, but as long as
metadata writes is marked correctly, other filesystems can also benifit
from this feature.

Qu Wenruo (2):
  dm log writes: Allow dm-log-writes to filter bios based on types to
    reduce log device space usage
  dm log writes: Introduce dump_type= message type to change dump_type
    on the fly

 drivers/md/dm-log-writes.c | 177 ++++++++++++++++++++++++++++++++++---
 1 file changed, 167 insertions(+), 10 deletions(-)

Comments

Qu Wenruo Aug. 8, 2019, 12:54 p.m. UTC | #1
Gentle ping?

This feature would be pretty useful if we want to really log heavy
operations on a relatively small log devices.

Thanks,
Qu

On 2019/6/19 下午4:03, Qu Wenruo wrote:
> Current dm-log-writes will record all bios, no matter if the bios is
> METADATA (normally what we care) or is DATA (normally we cares less for
> the log-replay context).
> 
> This causes a lot of extra space required for log device. E.g write 10M,
> sync, overwrite that 10M file, this would cause over 20M for log device
> just for the data.
> 
> This patchset introduces two way to specify the dump type:
> - dump_type=%s optional option for constructor
>   The default dump_type is ALL, thus no behavior change.
> 
> - dump_type=%s message type to change type on the fly
> 
> Also to cooperate the new dump_type= option, always output the dump_type
> for STATUSTYPE_TABLE.
> 
> A common use case would be:
>  # dmsetup create log --table 0 $(blockdev --getsz $dev) log-writes $dev $log_dev
>  # mkfs.btrfs -f /dev/mapper/log
>  # dmsetup suspend log
>  # dmsetup message log 0 dump_type=METADATA|FUA|FLUSH|DISCARD|MARK
>  # dmsetup resume log
>  # mount /dev/mapper/log <mnt>
>  # <do some work load>
>  # umount <mnt>
>  # dmsetup remove log
>  # <replay>
> 
> Now the log device will not record data writes, thus hugely reduce the
> space requirement for log device, allowing more operations to be down
> before hitting the space limit.
> 
> Currently btrfs check doesn't check data checksum by default, thus even
> we have wrong data on-disk, we should be fine checking the metadata.
> 
> I'm not 100% sure if this applies to other filesystems, but as long as
> metadata writes is marked correctly, other filesystems can also benifit
> from this feature.
> 
> Qu Wenruo (2):
>   dm log writes: Allow dm-log-writes to filter bios based on types to
>     reduce log device space usage
>   dm log writes: Introduce dump_type= message type to change dump_type
>     on the fly
> 
>  drivers/md/dm-log-writes.c | 177 ++++++++++++++++++++++++++++++++++---
>  1 file changed, 167 insertions(+), 10 deletions(-)
>
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel