LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Damien Le Moal <Damien.LeMoal@wdc.com>,
Paolo Valente <paolo.valente@linaro.org>,
Ming Lei <ming.lei@redhat.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] Revert "mq-deadline: Fix request accounting"
Date: Tue, 7 Sep 2021 16:07:57 +0000 [thread overview]
Message-ID: <YTeOW+GoW/Ps2NXq@x1-carbon> (raw)
In-Reply-To: <d544384b-617f-b7a4-f895-72adc900f41b@acm.org>
On Tue, Sep 07, 2021 at 07:54:09AM -0700, Bart Van Assche wrote:
> On 9/7/21 7:21 AM, Niklas Cassel wrote:
> > From: Niklas Cassel <niklas.cassel@wdc.com>
> >
> > This reverts commit b6d2b054e8baaee53fd2d4854c63cbf0f2c6262a.
> >
> > blk-mq will no longer call the I/O scheduler .finish_request() callback
> > for requests that were never inserted to the I/O scheduler.
> >
> > Therefore, we can remove the logic inside mq-deadline that was added to
> > workaround the (no longer existing) quirky behavior of blk-mq.
> >
> > Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> > ---
> > block/mq-deadline.c | 16 +++++-----------
> > 1 file changed, 5 insertions(+), 11 deletions(-)
> >
> > diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> > index 7f3c3932b723..b2d1e3adcb39 100644
> > --- a/block/mq-deadline.c
> > +++ b/block/mq-deadline.c
> > @@ -678,7 +678,6 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
> > prio = ioprio_class_to_prio[ioprio_class];
> > dd_count(dd, inserted, prio);
> > - rq->elv.priv[0] = (void *)(uintptr_t)1;
> > if (blk_mq_sched_try_insert_merge(q, rq, &free)) {
> > blk_mq_free_requests(&free);
> > @@ -727,10 +726,12 @@ static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
> > spin_unlock(&dd->lock);
> > }
> > -/* Callback from inside blk_mq_rq_ctx_init(). */
> > +/*
> > + * Nothing to do here. This is defined only to ensure that .finish_request
> > + * method is called upon request completion.
> > + */
> > static void dd_prepare_request(struct request *rq)
> > {
> > - rq->elv.priv[0] = NULL;
> > }
>
> Please take a look at
> https://lore.kernel.org/linux-block/18594aff-4a94-8a48-334c-f21ae32120c6@acm.org/
> If dd_prepare_request() is removed I will have to reintroduce it.
dd_prepare_request() itself is not removed, just the
rq->elv.priv[0] = NULL; inside dd_prepare_request().
If you need to modify dd_prepare_request() in a future
commit, that should be fine, no?
Without patch 1/2, e->type->ops.requeue_request() can get called
both for requests that bypassed the I/O scheduler, and for requests
that were inserted in the I/O scheduler.
See:
block/blk-mq-sched.h:blk_mq_sched_requeue_request()
If the RQF_ELVPRIV flag is not set, e->type->ops.requeue_request()
will not be called.
Perhaps you are having issues with requests that were inserted
in the scheduler, but later requeued?
If so, shouldn't these fixes help you, since you do not need to
worry about passthrough requests resulting in spurious calls to
the I/O scheduler callbacks?
Kind regards,
Niklas
next prev parent reply other threads:[~2021-09-07 16:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 14:21 [PATCH 0/2] don't call io scheduler callbacks for passthrough requests Niklas Cassel
2021-09-07 14:21 ` [PATCH 1/2] blk-mq: don't call callbacks for requests that bypassed the scheduler Niklas Cassel
2021-09-07 14:29 ` Ming Lei
2021-09-07 14:21 ` [PATCH 2/2] Revert "mq-deadline: Fix request accounting" Niklas Cassel
2021-09-07 14:54 ` Bart Van Assche
2021-09-07 16:07 ` Niklas Cassel [this message]
2021-09-07 16:49 ` Bart Van Assche
2021-09-07 15:15 ` Bart Van Assche
2021-09-07 16:28 ` Niklas Cassel
2021-09-07 17:12 ` Bart Van Assche
2021-09-08 11:57 ` Niklas Cassel
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=YTeOW+GoW/Ps2NXq@x1-carbon \
--to=niklas.cassel@wdc.com \
--cc=Damien.LeMoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=paolo.valente@linaro.org \
--subject='Re: [PATCH 2/2] Revert "mq-deadline: Fix request accounting"' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).