[Devel] [PATCH VZ9 v2 0/6] ploop BAT optimizations

Denis V. Lunev den at virtuozzo.com
Wed Oct 9 17:33:03 MSK 2024


On 10/9/24 14:17, Andrey Zhadchenko wrote:
> With this patchset, we start to check if the upcoming requests for ploop
> have REQ_FUA flag.
> If the flag is present:
>   - IO submits immediately, completion waits for BAT update
>   - BAT updates submit immediately
>   - set IOCB_DSYNC for writes and BAT updates
>   - BAT update does not trigger flush
> If the flag is absent:
>   - IO completion does not wait for BAT update
>   - all BAT updates are periodically submitted in a batch
>   - BAT update does not trigger flush
>
> New parameter with metadata submit delay can be specified when setting
> up ploop table
>
> v2 changes:
> - drop flush after BAT updates even for FUA requests
> - set IOCB_DSYNC flag on writes triggered by FUA
> - complete all accumulated metadata on FLUSH requests
> - support REQ_PREFLUSH flag
>
> Andrey Zhadchenko (3):
>    dm-ploop: do not flush BAT writes if request was not FUA
>    dm-ploop: do not wait for BAT update for non-FUA requests
>    dm-ploop: add delay for metadata writeback
>
>
> *** BLURB HERE ***
>
> Andrey Zhadchenko (6):
>    dm-ploop: do not flush after metadata writes
>    dm-ploop: set IOCB_DSYNC on all FUA requests
>    dm-ploop: do not wait for BAT update for non-FUA requests
>    dm-ploop: add delay for metadata writeback
>    dm-ploop: submit all postponed metadata on REQ_OP_FLUSH
>    dm-ploop: handle REQ_PREFLUSH
>
>   drivers/md/dm-ploop-bat.c    |   1 +
>   drivers/md/dm-ploop-map.c    | 154 +++++++++++++++++++++++++++--------
>   drivers/md/dm-ploop-target.c |  13 +++
>   drivers/md/dm-ploop.h        |   9 ++
>   4 files changed, 143 insertions(+), 34 deletions(-)
>
these patches do not work at all over 32 GB ramdisk

dev007 /mnt/ramdisk # ploop init -s 8G /mnt/ramdisk/root.hds
Creating delta /mnt/ramdisk/root.hds bs=2048 size=16777216 sectors v2
Adding snapshot {5fbaabe3-6958-40ff-92a7-860e329aab41}
Storing /mnt/ramdisk/DiskDescriptor.xml
Opening delta /mnt/ramdisk/root.hds
Opening delta /mnt/ramdisk/root.hds
Adding delta dev=/dev/mapper/ploop30904 img=/mnt/ramdisk/root.hds (rw)
Update inuse state /mnt/ramdisk/root.hds state=1953459801
Opening delta /mnt/ramdisk/root.hds
Running: partprobe /dev/mapper/ploop30904
Set untrusted /dev/mapper/ploop30904
Running: parted -s /dev/mapper/ploop30904 mklabel gpt
Running: sgdisk -n 1:2048:16775167 /dev/mapper/ploop30904
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Running: partprobe /dev/mapper/ploop30904
Running: mkfs.xfs -b size=4096 /dev/mapper/ploop30904p1
meta-data=/dev/mapper/ploop30904p1 isize=512    agcount=4, agsize=524160 
blks
          =                       sectsz=512   attr=2, projid32bit=1
          =                       crc=1        finobt=1, sparse=1, rmapbt=0
          =                       reflink=1    bigtime=1 inobtcount=1 
nrext64=0
data     =                       bsize=4096   blocks=2096640, imaxpct=25
          =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
          =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Discarding blocks...Done.
Metadata CRC error detected at 0x561dffbd10f0, xfs_agf block 0x1/0x200
Metadata CRC error detected at 0x561dffbd10f0, xfs_agf block 0x3ffc01/0x200
Metadata CRC error detected at 0x561dffbd10f0, xfs_agf block 0x7ff801/0x200
Metadata CRC error detected at 0x561dffbd10f0, xfs_agf block 0xbff401/0x200
Metadata CRC error detected at 0x561dffbee040, xfs_agi block 0x2/0x200
Metadata CRC error detected at 0x561dffbee040, xfs_agi block 0x3ffc02/0x200
Metadata CRC error detected at 0x561dffbee040, xfs_agi block 0x7ff802/0x200
Metadata CRC error detected at 0x561dffbee040, xfs_agi block 0xbff402/0x200
mkfs.xfs: Inode allocation failed [28 - No space left on device]
Error in run_prg_rc (util.c:309): Command mkfs.xfs -b size=4096 
/dev/mapper/ploop30904p1  exited with code 1
Umount /dev/mapper/ploop30904
DM command: remove /dev/mapper/ploop30904p1
DM message: /dev/mapper/ploop30904 get_img_name 0
Opening delta /mnt/ramdisk/root.hds
DM command: suspend /dev/mapper/ploop30904
DM command: resume /dev/mapper/ploop30904
Unmounting device /dev/mapper/ploop30904
DM command: resume /dev/mapper/ploop30904
DM command: remove /dev/mapper/ploop30904
Clear inuse state
Dropping image /mnt/ramdisk/root.hds
dev007 /mnt/ramdisk #

rmmod after that has been hanged.

Den


More information about the Devel mailing list