[dm-devel] [PATCH 0/4] dm-thin: reduce lock contention when walking the btree

Mikulas Patocka mpatocka at redhat.com
Mon Oct 10 12:35:05 UTC 2022


Here I'm sending the patches for dm-bufio and dm-thin that reduce lock 
contention when processing I/Os on already provisioned space.

The first patch introduces a new API to dm-bufio that allows to lock bufio 
and do multiple queries.

The second patch switches dm-bufio lock from mutex to rm_semaphore, so 
that we can process queries from multiple processes simultaneously.

The third patch simplifies struct ro_spine so that it holds a pointer to 
just one buffer.

The fourth patch makes dm-thin use the new dm-bufio interface when walking 
a btree.

I tested it on persistent memory (emulated with the "memmap" kernel 
argument). I set up the test with these commands:
# vgcreate vg /dev/pmem0
# lvcreate --thinpool pool -L 32GiB vg
# lvcreate -V 16GiB -n thin --thinpool pool vg
# dd if=/dev/zero of=/dev/vg/thin bs=1M oflag=direct status=progress

Then I used
# fio --ioengine=psync --iodepth=1 --rw=randrw --bs=4k --direct=1 
  --numjobs=12 --time_based --runtime=10 --group_reporting 

Throughput before the patches:
READ: bw=286MiB/s
WRITE: bw=286MiB/s

Throughput after the patches:
READ: bw=442MiB/s
WRITE: bw=442MiB/s


More information about the dm-devel mailing list