public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org, "Ewan D . Milne" <emilne@redhat.com>
Subject: Re: [PATCH] lib/sbitmap: allocate sb->map via kvzalloc_node
Date: Mon, 21 Mar 2022 20:01:20 -0600	[thread overview]
Message-ID: <9e78f4fb-f7c4-3f4f-cac1-40d4ee9455d5@kernel.dk> (raw)
In-Reply-To: <YjkXenfaI7iSewSC@T590>

On 3/21/22 6:25 PM, Ming Lei wrote:
> Hello,
> 
> On Wed, Mar 16, 2022 at 09:27:08AM +0800, Ming Lei wrote:
>> sbitmap has been used in scsi for replacing atomic operations on
>> sdev->device_busy, so IOPS on some fast scsi storage can be improved.
>>
>> However, sdev->device_busy can be changed in fast path, so we have to
>> allocate the sb->map statically. sdev->device_busy has been capped to 1024,
>> but some drivers may configure the default depth as < 8, then
>> cause each sbitmap word to hold only one bit. Finally 1024 * 128(
>> sizeof(sbitmap_word)) bytes is needed for sb->map, given it is order 5
>> allocation, sometimes it may fail.
>>
>> Avoid the issue by using kvzalloc_node() for allocating sb->map.
>>
>> Cc: Ewan D. Milne <emilne@redhat.com>
>> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> 
> Ping...

Was waiting on a response to the question on why we don't make this
dependent on size, but upon look at kvzalloc_node(), this is already
what it does. So I guess this looks fine to me too.

-- 
Jens Axboe


  reply	other threads:[~2022-03-22  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16  1:27 [PATCH] lib/sbitmap: allocate sb->map via kvzalloc_node Ming Lei
2022-03-16  2:54 ` Chaitanya Kulkarni
2022-03-22  0:25 ` Ming Lei
2022-03-22  2:01   ` Jens Axboe [this message]
2022-03-22  2:52 ` Jens Axboe

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=9e78f4fb-f7c4-3f4f-cac1-40d4ee9455d5@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=emilne@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox