linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* Re: [linux-lvm] how to set higher then 128 nr_requests on LV's
@ 2018-05-15  0:22 Mike Snitzer
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Snitzer @ 2018-05-15  0:22 UTC (permalink / raw)
  To: Pankaj Agarwal; +Cc: Hannes Reinecke, dm-devel, linux-lvm

[-- Attachment #1: Type: text/html, Size: 4211 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] how to set higher then 128 nr_requests on LV's
  2018-05-14 17:53   ` Mike Snitzer
@ 2018-05-14 23:57     ` Pankaj Agarwal
  0 siblings, 0 replies; 6+ messages in thread
From: Pankaj Agarwal @ 2018-05-14 23:57 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: Hannes Reinecke, dm-devel, linux-lvm

[-- Attachment #1: Type: text/plain, Size: 2744 bytes --]

Hannes,

While you are working on the feature code, is there a sequence of system
commands I can use ?

thanks,

Pankaj



On Mon, May 14, 2018 at 1:53 PM, Mike Snitzer <snitzer@redhat.com> wrote:

> On Mon, May 14 2018 at 12:13pm -0400,
> Mike Snitzer <snitzer@redhat.com> wrote:
>
> > On Sun, May 13 2018 at  8:47pm -0400,
> > Pankaj Agarwal <pankaj@releasemanager.in> wrote:
> >
> > >    Hi,
> > >    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.
> >
> > The only way to change this would be from the bottom up:
> > 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:
>
> [root@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
> [root@thegoat ~]# cat /sys/block/nullb0/queue/nr_requests
> 128
> [root@thegoat ~]# cat /sys/block/dm-0/queue/nr_requests
> 128
> [root@thegoat ~]# echo 64 > /sys/block/nullb0/queue/nr_requests
> [root@thegoat ~]# cat /sys/block/nullb0/queue/nr_requests
> 64
> [root@thegoat ~]# cat /sys/block/dm-0/queue/nr_requests
> 128
> [root@thegoat ~]# dmsetup suspend foo
> [root@thegoat ~]# dmsetup resume foo
> [root@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?
>

[-- Attachment #2: Type: text/html, Size: 3591 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] how to set higher then 128 nr_requests on LV's
  2018-05-14 16:13 ` Mike Snitzer
@ 2018-05-14 17:53   ` Mike Snitzer
  2018-05-14 23:57     ` Pankaj Agarwal
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Snitzer @ 2018-05-14 17:53 UTC (permalink / raw)
  To: Pankaj Agarwal; +Cc: Hannes Reinecke, dm-devel, linux-lvm

On Mon, May 14 2018 at 12:13pm -0400,
Mike Snitzer <snitzer@redhat.com> wrote:

> On Sun, May 13 2018 at  8:47pm -0400,
> Pankaj Agarwal <pankaj@releasemanager.in> wrote:
> 
> >    Hi,
> >    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.
> 
> The only way to change this would be from the bottom up:
> 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:

[root@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
[root@thegoat ~]# cat /sys/block/nullb0/queue/nr_requests
128
[root@thegoat ~]# cat /sys/block/dm-0/queue/nr_requests
128
[root@thegoat ~]# echo 64 > /sys/block/nullb0/queue/nr_requests
[root@thegoat ~]# cat /sys/block/nullb0/queue/nr_requests
64
[root@thegoat ~]# cat /sys/block/dm-0/queue/nr_requests
128
[root@thegoat ~]# dmsetup suspend foo
[root@thegoat ~]# dmsetup resume foo
[root@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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] how to set higher then 128 nr_requests on LV's
  2018-05-14  0:47 Pankaj Agarwal
  2018-05-14 14:21 ` Zdenek Kabelac
@ 2018-05-14 16:13 ` Mike Snitzer
  2018-05-14 17:53   ` Mike Snitzer
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Snitzer @ 2018-05-14 16:13 UTC (permalink / raw)
  To: Pankaj Agarwal; +Cc: linux-lvm

On Sun, May 13 2018 at  8:47pm -0400,
Pankaj Agarwal <pankaj@releasemanager.in> wrote:

>    Hi,
>    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.

The only way to change this would be from the bottom up:
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.

Mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] how to set higher then 128 nr_requests on LV's
  2018-05-14  0:47 Pankaj Agarwal
@ 2018-05-14 14:21 ` Zdenek Kabelac
  2018-05-14 16:13 ` Mike Snitzer
  1 sibling, 0 replies; 6+ messages in thread
From: Zdenek Kabelac @ 2018-05-14 14:21 UTC (permalink / raw)
  To: LVM general discussion and development, Pankaj Agarwal

Dne 14.5.2018 v 02:47 Pankaj Agarwal napsal(a):
> Hi,
> 
> 
> 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
> #


Hi

Lvm2 is 'logical volume manager'  - so it really is just managing your metadata.

So you basically ask how you change this value for 'DM' device (managed by lvm2).

And IMHO my answer would be - you can't change this setting for DM device as 
you use whatever comes from the layer bellow DM - so i.e. if you use  PV as 
/dev/sdb  - you need to set this setting for your /dev/sdb  device.

Regards

Zdenek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [linux-lvm] how to set higher then 128 nr_requests on LV's
@ 2018-05-14  0:47 Pankaj Agarwal
  2018-05-14 14:21 ` Zdenek Kabelac
  2018-05-14 16:13 ` Mike Snitzer
  0 siblings, 2 replies; 6+ messages in thread
From: Pankaj Agarwal @ 2018-05-14  0:47 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

Hi,


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
#

Thanks,

Pankaj

[-- Attachment #2: Type: text/html, Size: 552 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-15  0:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  0:22 [linux-lvm] how to set higher then 128 nr_requests on LV's Mike Snitzer
  -- strict thread matches above, loose matches on Subject: below --
2018-05-14  0:47 Pankaj Agarwal
2018-05-14 14:21 ` Zdenek Kabelac
2018-05-14 16:13 ` Mike Snitzer
2018-05-14 17:53   ` Mike Snitzer
2018-05-14 23:57     ` Pankaj Agarwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).