All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Zhiguo Niu <niuzhiguo84@gmail.com>
Cc: Zhiguo Niu <zhiguo.niu@unisoc.com>,
	axboe@kernel.dk, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org, ke.wang@unisoc.com,
	hongyu.jin@unisoc.com, Damien Le Moal <dlemoal@kernel.org>
Subject: Re: [PATCH] block/mq-deadline: Fix WARN when set async_depth by sysfs
Date: Tue, 2 Apr 2024 16:20:22 -0700	[thread overview]
Message-ID: <c56a1d54-6d7d-4105-8109-d6a81bc1adbc@acm.org> (raw)
In-Reply-To: <CAHJ8P3KgU-tFDAgCNc5GcPbUBtDDyFmcfza2HsoD9TJ3h1DS=Q@mail.gmail.com>

On 4/1/24 10:44 PM, Zhiguo Niu wrote:
> On Tue, Apr 2, 2024 at 5:23 AM Bart Van Assche <bvanassche@acm.org> wrote:
>> Oops, I misread your patch. After having taken another look, my
>> conclusions are as follows:
>> * sbitmap_queue_min_shallow_depth() is called. This causes
>>     sbq->wake_batch to be modified but I don't think that it is a proper
>>     fix for dd_limit_depth().
> yes, it will affect sbq->wake_batch,  But judging from the following code:
> [ ... ]

If we want to allow small values of dd->async_depth, min_shallow_depth
must be 1. The BFQ I/O scheduler also follows this approach.

>> * dd_limit_depth() still assigns a number in the range 1..nr_requests to
>>     data->shallow_depth while a number in the range 1..(1<<bt->sb.shift)
>>     should be assigned.
> yes, In order to avoid the performance regression problem that Harshit
> Mogalapalli reported, this patch will not directly modify
> dd->async_depth,
> but user can modify dd->async_depth from sysfs according to user's
> request. which will modify data->shallow_depth after user modify it by
> sysfs.

It seems like there is no other option than keeping the current default
depth limit for async requests ...

> My personal opinion is to keep the current dd->aync_depth unchanged to
> avoid causing performance regression,
> but it should  allow users to set it by sysfs, and the WARN mentioned
> best to be solved.
> and just only change this part?
>   -       sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, dd->async_depth);
>   +       sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, 1);
> thanks!

The above change will suppress the kernel warning. I think the other
changes from patch 2/2 are also necessary. Otherwise the unit of
"async_depth" will depend on sbitmap word shift parameter. I don't think
that users should have to worry about which shift value has been chosen
by the sbitmap implementation.

Thanks,

Bart.


  reply	other threads:[~2024-04-02 23:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  2:44 [PATCH] block/mq-deadline: Fix WARN when set async_depth by sysfs Zhiguo Niu
2024-03-29  3:40 ` Damien Le Moal
2024-03-29  9:43   ` Zhiguo Niu
2024-03-29 18:08 ` Bart Van Assche
2024-04-01  0:58   ` Zhiguo Niu
2024-04-01 21:23     ` Bart Van Assche
2024-04-02  5:44       ` Zhiguo Niu
2024-04-02 23:20         ` Bart Van Assche [this message]
2024-04-03  5:41           ` Zhiguo Niu

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=c56a1d54-6d7d-4105-8109-d6a81bc1adbc@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=hongyu.jin@unisoc.com \
    --cc=ke.wang@unisoc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niuzhiguo84@gmail.com \
    --cc=zhiguo.niu@unisoc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.