From: Jens Axboe <axboe@kernel.dk>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Christoph Hellwig <hch@infradead.org>
Cc: linux-block@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org,
usb-storage@lists.one-eyed-alien.net,
Ulf Hansson <ulf.hansson@linaro.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC PATCH 1/3] blk-mq: Add blk_mq_complete_request_direct()
Date: Sun, 17 Oct 2021 10:19:48 -0600 [thread overview]
Message-ID: <951f4cde-fcc8-f5fe-845a-ccdc3f360428@kernel.dk> (raw)
In-Reply-To: <20211015161533.5cnhqqd3asy3e3vg@linutronix.de>
On 10/15/21 10:15 AM, Sebastian Andrzej Siewior wrote:
> On 2021-10-15 09:03:28 [-0700], Christoph Hellwig wrote:
>> On Fri, Oct 15, 2021 at 05:14:10PM +0200, Sebastian Andrzej Siewior wrote:
>>> +void blk_mq_complete_request_direct(struct request *rq)
>>> +{
>>> + WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
>>> + rq->q->mq_ops->complete(rq);
>>> +}
>>
>> As this is called by the driver we known what ->complete this helper
>> would call. So instead of doing this we could just call
>> blk_mq_set_request_complete and the actual completion helper.
>> The comment above it will need some updates of course.
>
> So
> blk_mq_set_request_complete();
> mmc_blk_mq_complete();
>
> for the mmc driver and no fiddling in the blk-mq then.
Just pass in the handler:
void blk_mq_complete_request_direct(struct request *rq,
void (*complete)(struct request *rq))
{
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
complete(rq);
}
And we should probably put it in blk-mq.h so it inlines nicely, and
that'll be faster than the indirect call.
--
Jens Axboe
next prev parent reply other threads:[~2021-10-17 16:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 15:14 [RFC PATCH 0/3] blk-mq: Allow to complete requests directly Sebastian Andrzej Siewior
2021-10-15 15:14 ` [RFC PATCH 1/3] blk-mq: Add blk_mq_complete_request_direct() Sebastian Andrzej Siewior
2021-10-15 16:03 ` Christoph Hellwig
2021-10-15 16:15 ` Sebastian Andrzej Siewior
2021-10-17 16:19 ` Jens Axboe [this message]
2021-10-15 15:14 ` [RFC PATCH 2/3] mmc: core: Use blk_mq_complete_request_direct() Sebastian Andrzej Siewior
2021-10-15 15:14 ` [RFC PATCH 3/3] scsi, usb: storage: Complete the blk-request directly Sebastian Andrzej Siewior
2021-10-15 16:04 ` Christoph Hellwig
2021-10-15 16:16 ` Sebastian Andrzej Siewior
2021-10-17 2:17 ` Bart Van Assche
2021-10-18 10:53 ` Sebastian Andrzej Siewior
2021-10-16 21:21 ` Bart Van Assche
2021-10-18 11:10 ` Sebastian Andrzej Siewior
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=951f4cde-fcc8-f5fe-845a-ccdc3f360428@kernel.dk \
--to=axboe@kernel.dk \
--cc=bigeasy@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=jejb@linux.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stern@rowland.harvard.edu \
--cc=tglx@linutronix.de \
--cc=ulf.hansson@linaro.org \
--cc=usb-storage@lists.one-eyed-alien.net \
/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