linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Ming Lei <ming.lei@redhat.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Martijn Coenen <maco@android.com>
Subject: Re: [PATCH v2 3/3] loop: Add the default_queue_depth kernel module parameter
Date: Wed, 4 Aug 2021 08:07:58 +0200	[thread overview]
Message-ID: <YQouvmh3rTDz2WIE@kroah.com> (raw)
In-Reply-To: <20210803182304.365053-4-bvanassche@acm.org>

On Tue, Aug 03, 2021 at 11:23:04AM -0700, Bart Van Assche wrote:
> Recent versions of Android use the zram driver on top of the loop driver.
> There is a mismatch between the default loop driver queue depth (128) and
> the queue depth of the storage device in my test setup (32). That mismatch
> results in write latencies that are higher than necessary. Address this
> issue by making the default loop driver queue depth configurable. Compared
> to configuring the queue depth by writing into the nr_requests sysfs
> attribute, this approach does not involve calling synchronize_rcu() to
> modify the queue depth.
> 
> Reviewed-by: Ming Lei <ming.lei@redhat.com>
> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Martijn Coenen <maco@android.com>
> Cc: Jaegeuk Kim <jaegeuk@kernel.org>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/block/loop.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index fa1c298a8cfb..b5dbf2d7447e 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -2098,6 +2098,9 @@ module_param(max_loop, int, 0444);
>  MODULE_PARM_DESC(max_loop, "Maximum number of loop devices");
>  module_param(max_part, int, 0444);
>  MODULE_PARM_DESC(max_part, "Maximum number of partitions per loop device");
> +static uint32_t default_queue_depth = 128;
> +module_param(default_queue_depth, uint, 0644);
> +MODULE_PARM_DESC(default_queue_depth, "Default loop device queue depth");
>  MODULE_LICENSE("GPL");
>  MODULE_ALIAS_BLOCKDEV_MAJOR(LOOP_MAJOR);

Please no, this is not the 1990's, we do not need module-wide options
like this that are hard to ever remove.  Worst case, this should be a
per-device option so it needs to be controllable that way.

But really, why can this not just be "tuned" on the fly?  How would
anyone know what to set this value to?  Should we just bump it up anyway
given that modern memory limits are probably more now?

thanks,

greg k-h

  reply	other threads:[~2021-08-04  6:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 18:23 [PATCH v2 0/3] Improve loop driver I/O scheduler and QD selection Bart Van Assche
2021-08-03 18:23 ` [PATCH v2 1/3] blk-mq: Introduce the BLK_MQ_F_NO_SCHED_BY_DEFAULT flag Bart Van Assche
2021-08-03 18:23 ` [PATCH v2 2/3] loop: Select I/O scheduler 'none' from inside add_disk() Bart Van Assche
2021-08-04  2:39   ` Ming Lei
2021-08-04 17:43     ` Bart Van Assche
2021-08-05  3:26       ` Ming Lei
2021-08-05 16:49         ` Bart Van Assche
2021-08-04 17:58     ` Jens Axboe
2021-08-04  5:35   ` Christoph Hellwig
2021-08-04 17:58     ` Bart Van Assche
2021-08-04 18:04       ` Jens Axboe
2021-08-05  6:39       ` Christoph Hellwig
2021-08-03 18:23 ` [PATCH v2 3/3] loop: Add the default_queue_depth kernel module parameter Bart Van Assche
2021-08-04  6:07   ` Greg KH [this message]
2021-08-04 17:38     ` Bart Van Assche
2021-08-04 19:33       ` Greg KH
2021-08-05  6:14     ` Chaitanya Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YQouvmh3rTDz2WIE@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=jaegeuk@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=maco@android.com \
    --cc=ming.lei@redhat.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).