From: Christoph Hellwig <hch@infradead.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 1/4] block: provide helpers for rq_list manipulation
Date: Wed, 13 Oct 2021 18:11:52 +0100 [thread overview]
Message-ID: <YWcTWJzo2WV9L/k9@infradead.org> (raw)
In-Reply-To: <20211013164937.985367-2-axboe@kernel.dk>
On Wed, Oct 13, 2021 at 10:49:34AM -0600, Jens Axboe wrote:
> Instead of open-coding the list additions, traversal, and removal,
> provide a basic set of helpers.
>
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
> block/blk-mq.c | 21 +++++----------------
> include/linux/blk-mq.h | 25 +++++++++++++++++++++++++
> 2 files changed, 30 insertions(+), 16 deletions(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 6dfd3aaa6073..46a91e5fabc5 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -426,10 +426,10 @@ static struct request *__blk_mq_alloc_requests(struct blk_mq_alloc_data *data)
> tag = tag_offset + i;
> tags &= ~(1UL << i);
> rq = blk_mq_rq_ctx_init(data, tag, alloc_time_ns);
> - rq->rq_next = *data->cached_rq;
> - *data->cached_rq = rq;
> + rq_list_add_tail(data->cached_rq, rq);
> }
This doesn't seem to match the code in the current for-5.6/block branch.
> data->nr_tags -= nr;
> + return rq_list_pop(data->cached_rq);
> } else {
But either way no need for an else after a return.
next prev parent reply other threads:[~2021-10-13 17:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 16:49 [PATCHSET 0/4] Various block optimizations Jens Axboe
2021-10-13 16:49 ` [PATCH 1/4] block: provide helpers for rq_list manipulation Jens Axboe
2021-10-13 17:11 ` Christoph Hellwig [this message]
2021-10-13 17:47 ` Jens Axboe
2021-10-13 16:49 ` [PATCH 2/4] block: inline fast path of driver tag allocation Jens Axboe
2021-10-13 17:22 ` Christoph Hellwig
2021-10-13 17:46 ` Jens Axboe
2021-10-13 17:57 ` Christoph Hellwig
2021-10-13 18:07 ` Jens Axboe
2021-10-13 16:49 ` [PATCH 3/4] block: don't bother iter advancing a fully done bio Jens Axboe
2021-10-13 17:26 ` Christoph Hellwig
2021-10-13 17:46 ` Jens Axboe
2021-10-13 16:49 ` [PATCH 4/4] block: move update request helpers into blk-mq.c Jens Axboe
2021-10-13 17:32 ` Christoph Hellwig
2021-10-13 17:46 ` Jens Axboe
2021-10-13 17:54 ` Christoph Hellwig
2021-10-13 17:57 ` Jens Axboe
2021-10-14 5:00 ` Christoph Hellwig
2021-10-14 15:14 ` 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=YWcTWJzo2WV9L/k9@infradead.org \
--to=hch@infradead.org \
--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