From: Omar Sandoval <osandov@osandov.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] sbitmap: optimize wakeup check
Date: Fri, 30 Nov 2018 13:37:50 -0800 [thread overview]
Message-ID: <20181130213750.GA11220@vader> (raw)
In-Reply-To: <20181130160118.24683-3-axboe@kernel.dk>
On Fri, Nov 30, 2018 at 09:01:18AM -0700, Jens Axboe wrote:
> Even if we have no waiters on any of the sbitmap_queue wait states, we
> still have to loop every entry to check. We do this for every IO, so
> the cost adds up.
>
> Shift a bit of the cost to the slow path, when we actually have waiters.
> Wrap prepare_to_wait_exclusive() and finish_wait(), so we can maintain
> an internal count of how many are currently active. Then we can simply
> check this count in sbq_wake_ptr() and not have to loop if we don't
> have any sleepers.
>
> Convert the two users of sbitmap with waiting, blk-mq-tag and iSCSI.
Reviewed-by: Omar Sandoval <osandov@fb.com>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
> block/blk-mq-tag.c | 11 ++++----
> drivers/target/iscsi/iscsi_target_util.c | 12 +++++----
> include/linux/sbitmap.h | 34 ++++++++++++++++++++++++
> lib/sbitmap.c | 28 +++++++++++++++++++
> 4 files changed, 74 insertions(+), 11 deletions(-)
next prev parent reply other threads:[~2018-11-30 21:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 16:01 [PATCHSET v4] sbitmap optimizations Jens Axboe
2018-11-30 16:01 ` [PATCH 1/2] sbitmap: ammortize cost of clearing bits Jens Axboe
2018-11-30 20:03 ` Omar Sandoval
2018-11-30 20:10 ` Jens Axboe
2018-11-30 21:41 ` Omar Sandoval
2018-11-30 16:01 ` [PATCH 2/2] sbitmap: optimize wakeup check Jens Axboe
2018-11-30 21:37 ` Omar Sandoval [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-11-30 2:09 [PATCHSET v3] sbitmap optimizations Jens Axboe
2018-11-30 2:09 ` [PATCH 2/2] sbitmap: optimize wakeup check 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=20181130213750.GA11220@vader \
--to=osandov@osandov.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/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