On Mon, May 14 2018 at 12:13pm -0400,
Post by Mike SnitzerOn Sun, May 13 2018 at 8:47pm -0400,
Post by Pankaj AgarwalHi,
How do i set the nr_request value for LV's as it's not writable like other
drives on a linux system.
LV's are set as dm-0 and dm-1 on my system.
#cat /sys/block/dm-0/queue/nr_requests
128
# echo 256 > /sys/block/dm-0/queue/nr_requests
-bash: echo: write error: Invalid argument
In the block layer, bio-based devices cannot have their nr_requests
changed, see: block/blk-sysfs.c:queue_requests_store()
So any bio-based DM device (e.g. linear target) won't be allowed to
change nr_requests.
1) change the underlying request-based device(s) (e.g. /dev/sda)
2) dmsetup suspend + dmsetup resume any bio-based DM device(s) that are
stacked ontop of the request-based device(s) you changed in 1)
-- this will restack the queue_limits from the bottom up; so the DM
device will then reflect the underlying devices' limits.
I was mistaken. DM core (in the kernel) will only restack the
queue_limits (nr_requests included) if a new DM table is loaded.
So a simple suspend+resume will _not_ change the bio-based DM device's
queue_limits:
[***@thegoat ~]# lsblk /dev/nullb0
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nullb0 253:0 0 250G 0 disk
└─foo 252:0 0 250G 0 dm
[***@thegoat ~]# cat /sys/block/nullb0/queue/nr_requests
128
[***@thegoat ~]# cat /sys/block/dm-0/queue/nr_requests
128
[***@thegoat ~]# echo 64 > /sys/block/nullb0/queue/nr_requests
[***@thegoat ~]# cat /sys/block/nullb0/queue/nr_requests
64
[***@thegoat ~]# cat /sys/block/dm-0/queue/nr_requests
128
[***@thegoat ~]# dmsetup suspend foo
[***@thegoat ~]# dmsetup resume foo
[***@thegoat ~]# cat /sys/block/dm-0/queue/nr_requests
128
There was some related work started in this area by Hannes (now cc'd)
during LSF last month. He added a chain-notifier to DM devices so that
if any underlying devices (devices referenced in a DM device's table)
were changed then the enture device stack would have its limits
reloaded.
Not sure where Hannes ended up with that. Would love to get it polished
now and staged for 4.18 inclusion.
Hannes?