<div dir="ltr">Hi Zdenek and team!<br><br>This issue looks very similar to dm block IO handling not using blkmq driver.<br>IIRC the queue limits are not honoured for non blkmq devices.<br><br>So how can thin pool/thin dm devices be forced to use blkmq rq based device driver?<br>As noted in this thread, we are seeing a huge number of inflight IO on the dm device and any sync takes a huge time to complete.<br>Please advise.<br><br>As a reference I compared a root ssd with the thin device and the appropriate sysfs dir(mq) is missing for dm devices, clearly indicating that dm device do not use blkmq rq based driver. See further logs below.<br><br>```<br>A sample thin device.<br>[root@ip-70-0-75-200 ~]# dmsetup table pwx0-1076133386023951605<br>0 20971520 thin 253:2 17<br>[root@ip-70-0-75-200 ~]# dmsetup info !$<br>dmsetup info pwx0-1076133386023951605<br>Name:              pwx0-1076133386023951605<br>State:             ACTIVE<br>Read Ahead:        0<br>Tables present:    LIVE<br>Open count:        2<br>Event number:      0<br>Major, minor:      253, 14<br>Number of targets: 1<br>UUID: LVM-fREck6REefH765WAA8XAPZn6j78uhNBQHKcYDE9TSjDIk2tLGk5cDz0y7GNcz94C<br><br>[root@ip-70-0-75-200 ~]# ls -al /dev/mapper/pwx0-1076133386023951605<br>lrwxrwxrwx 1 root root 8 Dec 10 16:49 /dev/mapper/pwx0-1076133386023951605 -> ../dm-14<br>[root@ip-70-0-75-200 ~]# ls -l /sys/block/dm-14/ <<<<<< NOTE no mq sysfs file here<br>total 0<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 alignment_offset<br>lrwxrwxrwx 1 root root    0 Dec 10 17:13 bdi -> ../../bdi/253:14<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 capability<br>-r--r--r-- 1 root root 4096 Dec 10 17:08 dev<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 discard_alignment<br>drwxr-xr-x 2 root root    0 Dec 10 17:08 dm<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 events<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 events_async<br>-rw-r--r-- 1 root root 4096 Dec 10 17:13 events_poll_msecs<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 ext_range<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 hidden<br>drwxr-xr-x 2 root root    0 Dec 10 17:08 holders<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 inflight<br>drwxr-xr-x 2 root root    0 Dec 10 17:13 integrity<br>drwxr-xr-x 2 root root    0 Dec 10 17:13 power<br>drwxr-xr-x 2 root root    0 Dec 10 17:08 queue<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 range<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 removable<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 ro<br>-r--r--r-- 1 root root 4096 Dec 10 17:08 size<br>drwxr-xr-x 2 root root    0 Dec 10 17:08 slaves<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 stat<br>lrwxrwxrwx 1 root root    0 Dec 10 17:08 subsystem -> ../../../../class/block<br>drwxr-xr-x 2 root root    0 Dec 10 17:13 trace<br>-rw-r--r-- 1 root root 4096 Dec 10 16:48 uevent<br>[root@ip-70-0-75-200 ~]# ls -l /sys/block/dm-14/dm<br>total 0<br>-r--r--r-- 1 root root 4096 Dec 10 17:08 name<br>-rw-r--r-- 1 root root 4096 Dec 10 17:13 rq_based_seq_io_merge_deadline<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 suspended<br>-r--r--r-- 1 root root 4096 Dec 10 17:13 use_blk_mq<br>-r--r--r-- 1 root root 4096 Dec 10 17:08 uuid<br>[root@ip-70-0-75-200 ~]# cat /sys/block/dm-14/dm/use_blk_mq <<<<< THIS IS STUBBED TO BE ALWAYS '1'<br>1<br>[root@ip-70-0-75-200 ~]#<br>[root@ip-70-0-75-200 ~]#<br>[root@ip-70-0-75-200 ~]# ls -al /sys/block/sda/<br>total 0<br>drwxr-xr-x 11 root root    0 Dec 10 17:08 .<br>drwxr-xr-x  3 root root    0 Dec 10 17:08 ..<br>-r--r--r--  1 root root 4096 Dec 10 17:14 alignment_offset<br>lrwxrwxrwx  1 root root    0 Dec 10 17:14 bdi -> ../../../../../../../virtual/bdi/8:0<br>-r--r--r--  1 root root 4096 Dec 10 17:14 capability<br>-r--r--r--  1 root root 4096 Dec 10 17:08 dev<br>lrwxrwxrwx  1 root root    0 Dec 10 17:08 device -> ../../../2:0:0:0<br>-r--r--r--  1 root root 4096 Dec 10 17:14 discard_alignment<br>-r--r--r--  1 root root 4096 Dec 10 17:14 events<br>-r--r--r--  1 root root 4096 Dec 10 17:14 events_async<br>-rw-r--r--  1 root root 4096 Dec 10 17:14 events_poll_msecs<br>-r--r--r--  1 root root 4096 Dec 10 17:14 ext_range<br>-r--r--r--  1 root root 4096 Dec 10 17:14 hidden<br>drwxr-xr-x  2 root root    0 Dec 10 17:08 holders<br>-r--r--r--  1 root root 4096 Dec 10 17:14 inflight<br>drwxr-xr-x  2 root root    0 Dec 10 17:14 integrity<br>drwxr-xr-x  3 root root    0 Dec 10 17:14 mq <<<<<<<<<<<< root SSD has 'mq' sysfs directory for blkmq implementation <br>drwxr-xr-x  2 root root    0 Dec 10 17:14 power<br>drwxr-xr-x  3 root root    0 Dec 10 17:14 queue<br>-r--r--r--  1 root root 4096 Dec 10 17:14 range<br>-r--r--r--  1 root root 4096 Dec 10 17:14 removable<br>-r--r--r--  1 root root 4096 Dec 10 17:14 ro<br>drwxr-xr-x  5 root root    0 Dec 10 17:08 sda1<br>drwxr-xr-x  5 root root    0 Dec 10 17:08 sda2<br>-r--r--r--  1 root root 4096 Dec 10 17:14 size<br>drwxr-xr-x  2 root root    0 Dec 10 17:14 slaves<br>-r--r--r--  1 root root 4096 Dec 10 17:14 stat<br>lrwxrwxrwx  1 root root    0 Dec 10 17:08 subsystem -> ../../../../../../../../class/block<br>drwxr-xr-x  2 root root    0 Dec 10 17:14 trace<br>-rw-r--r--  1 root root 4096 Dec 10 16:49 uevent<br>[root@ip-70-0-75-200 ~]# ls -al /sys/block/sda/mq<br>total 0<br>drwxr-xr-x  3 root root 0 Dec 10 17:14 .<br>drwxr-xr-x 11 root root 0 Dec 10 17:08 ..<br>drwxr-xr-x  6 root root 0 Dec 10 17:14 0<br>[root@ip-70-0-75-200 ~]# ls -al /sys/block/sda/mq/0<br>total 0<br>drwxr-xr-x 6 root root    0 Dec 10 17:14 .<br>drwxr-xr-x 3 root root    0 Dec 10 17:14 ..<br>drwxr-xr-x 2 root root    0 Dec 10 17:14 cpu0<br>drwxr-xr-x 2 root root    0 Dec 10 17:14 cpu1<br>drwxr-xr-x 2 root root    0 Dec 10 17:14 cpu2<br>drwxr-xr-x 2 root root    0 Dec 10 17:14 cpu3<br>-r--r--r-- 1 root root 4096 Dec 10 17:14 cpu_list<br>-r--r--r-- 1 root root 4096 Dec 10 17:14 nr_reserved_tags<br>-r--r--r-- 1 root root 4096 Dec 10 17:14 nr_tags<br>[root@ip-70-0-75-200 ~]#<br>```<br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 8, 2021 at 10:38 PM Lakshmi Narasimhan Sundararajan <<a href="mailto:lsundararajan@purestorage.com">lsundararajan@purestorage.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Zdenek,<div>Thanks for the reply.<br>I have confirmation on the Zeroing of thin chunks, they are disabled.</div><div>And I followed it up further to post additional details I collected on the same write performance issue.<br><br>The summary is, for buffered IO there seems to be way more IOs queued than by the configured limit (queue/nr_requests).<br>The thin dm device is not honouring this limit and has so many excess IO in flight, that any sync IO eventually stalls for a very long time.<br><br>The details are in the thread. Can you confirm if this is a known issue? And what workaround would you suggest?<br>If not pointers, to possible areas to explore?</div><div><br>Regards<br><br><br><br><br><br><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 6, 2021 at 7:27 PM Zdenek Kabelac <<a href="mailto:zdenek.kabelac@gmail.com" target="_blank">zdenek.kabelac@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dne 06. 12. 21 v 7:11 Lakshmi Narasimhan Sundararajan napsal(a):<br>
> Bumping this thread, any inputs would be appreciated.<br>
> <br>
>>>>> Do you measure writes while provisioning thin chunks or on already provisioned<br>
>>>>> device?<br>
>>>>><br>
>>>><br>
>>>> Hi Zdenek,<br>
>>>> These are traditional HDDs. Both the thin pool data/metadata reside on<br>
>>>> the same set of drive(s).<br>
>>>> I understand where you are going with this, I will look further into<br>
>>>> defining the hardware/disk before I bring it to your attention.<br>
>>>><br>
>>>> This run was not on an already provisioned device. I do see improved<br>
>>>> performance of the same volume after the first write.<br>
>>>> I understand this perf gain to be the overhead that is avoided during<br>
>>>> the subsequent run where no mappings need to be established.<br>
>>>><br>
>>>> But, you mentioned zeroing of provisioned blocks as an issue.<br>
>>>> 1/ during lvcreate -Z from the man pages reports only controls the<br>
>>>> first 4K block. And also implies this is a MUST otherwise fs may hang.<br>
>>>> So, we are using this. Are you saying this controls zeroing of each<br>
>>>> chunk that's mapped to the thin volume?<br>
<br>
Yes - for 'lvcreate --type thin-pool' the option -Z controls 'zeroing' of <br>
thin-pool's thin volumes<br>
<br>
The bigger the chunks are, the bigger the impact of zeroing will be.<br>
<br>
<br>
>>>><br>
>>>> 2/ The other about zeroing all the data chunks mapped to the thin<br>
>>>> volume, I could see only reference in the lvm.conf under<br>
>>>> thin_pool_zero,<br>
>>>> This is default enabled. So are you suggesting I disable this?<br>
<br>
If you don't need it - disable it - it's kind of more secure to have it <br>
enabled - but if you use 'filesystem' like  ext4 on top - zeroing doesn't help <br>
as user of filesystem cannot read unwritten data. However if you read<br>
device as root - you might be able to read 'stale' data from unwritten parts <br>
of data from provisioned chunks.<br>
<br>
<br>
>>>><br>
>>>> Please confirm the above items. I will come back with more precise<br>
>>>> details on the details you had requested for.<br>
>>>><br>
<br>
<br>
As a side note - metadata device should preferabl sit on different spindle <br>
(SSD, nvme,...) as this is high-bandwith device and might frequently collide <br>
with your  _tdata volume writes.<br>
<br>
Regrards<br>
<br>
Zdenek<br>
</blockquote></div>
</blockquote></div>