• Mikulas Patocka's avatar
    dm writecache: improve performance of large linear writes on SSDs · dcd19507
    Mikulas Patocka authored
    When dm-writecache is used with SSD as a cache device, it would submit a
    separate bio for each written block. The I/Os would be merged by the disk
    scheduler, but this merging degrades performance.
    
    Improve dm-writecache performance by submitting larger bios - this is
    possible as long as there is consecutive free space on the cache
    device.
    
    Benchmark (arm64 with 64k page size, using /dev/ram0 as a cache device):
    
    fio --bs=512k --iodepth=32 --size=400M --direct=1 \
        --filename=/dev/mapper/cache --rw=randwrite --numjobs=1 --name=test
    
    block	old	new
    size	MiB/s	MiB/s
    ---------------------
    512	181	700
    1k	347	1256
    2k	644	2020
    4k	1183	2759
    8k	1852	3333
    16k	2469	3509
    32k	2974	3670
    64k	3404	3810
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    dcd19507
dm-writecache.c 57.8 KB