From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"Ewan D . Milne" <emilne@redhat.com>
Subject: Re: [PATCH] lib/sbitmap: allocate sb->map via kvzalloc_node
Date: Wed, 16 Mar 2022 02:54:36 +0000 [thread overview]
Message-ID: <cd8cce7a-708e-fb39-bc7d-4f086bda3cba@nvidia.com> (raw)
In-Reply-To: <20220316012708.354668-1-ming.lei@redhat.com>
On 3/15/22 18:27, 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>
> ---
>
maybe considering the total size before actual allocation
that will not buy us anything ?
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
next prev parent reply other threads:[~2022-03-16 2:54 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 [this message]
2022-03-22 0:25 ` Ming Lei
2022-03-22 2:01 ` Jens Axboe
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=cd8cce7a-708e-fb39-bc7d-4f086bda3cba@nvidia.com \
--to=chaitanyak@nvidia.com \
--cc=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