[dm-devel] dm-era over mdadm raid5 loses discard support
vitalif at yourcmc.ru
vitalif at yourcmc.ru
Fri Nov 19 22:43:02 UTC 2021
Hi
Just to note, the problem is solved by setting raid456.devices_handle_discard_safely=Y in kernel command line.
It seems that dm-table.c checks for blk_queue_discard() of underlying devices and RAID5 device has the QUEUE_FLAG_DISCARD unset and at the same time discard_granularity != 0. So discards actually work even without raid456.devices_handle_discard_safely=Y, but aren't passed via the DM device.
> Even worse, dm-linear has the same problem.
>
> dm-linear over mdadm RAID5 doesn't support discard while mdadm device itself supports it.
>
>> Hi!
>>
>> A dm-era device created over a RAID5 array loses discard support.
>>
>> Test script is attached.
>>
>> If you run it on SSD you'll see something like:
>>
>> loop0 4096
>> loop1 4096
>> loop2 4096
>> loop3 4096
>> md55 1048576
>> loop_test_era 0
>>
>> I.e. mdadm device supports discard, but dm-era device started over it doesn't.
>>
>> If you create a dm-era device over a normal block device without mdadm RAID5 or even over mdadm
>> RAID1 - it will preserve discard support.
>>
>> Why? How can it be fixed?
>>
>> --
>> With best regards,
>> Vitaliy Filippov
>>
>> --
>> dm-devel mailing list
>> dm-devel at redhat.com
>> https://listman.redhat.com/mailman/listinfo/dm-devel
>
> --
> dm-devel mailing list
> dm-devel at redhat.com
> https://listman.redhat.com/mailman/listinfo/dm-devel
More information about the dm-devel
mailing list