From: Christoph Hellwig <hch@infradead.org>
To: Andrzej Jakowski <andrzej.jakowski@linux.intel.com>
Cc: axboe@kernel.dk, song@kernel.org, linux-block@vger.kernel.org,
linux-raid@vger.kernel.org,
Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Subject: Re: [PATCH 1/2] block: introduce polling on bio level
Date: Thu, 30 Jan 2020 22:34:07 -0800 [thread overview]
Message-ID: <20200131063407.GB6267@infradead.org> (raw)
In-Reply-To: <20200126044138.5066-2-andrzej.jakowski@linux.intel.com>
On Sat, Jan 25, 2020 at 09:41:37PM -0700, Andrzej Jakowski wrote:
> if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q))
> - goto not_supported;
> + if (!(bio->bi_opf & REQ_HIPRI))
> + goto not_supported;
Can you explain this check? This looks weird to me I think we need
a generalized check if a make_request based driver supports REQ_NOWAIT
instead (and as a separate patch / patchset).
> + if (q->bio_poll_fn != NULL) {
> + state = current->state;
> + do {
> + int ret;
> +
> + ret = q->bio_poll_fn(q, cookie);
> + if (ret > 0) {
> + __set_current_state(TASK_RUNNING);
> + return ret;
> + }
> +
> + if (signal_pending_state(state, current))
> + __set_current_state(TASK_RUNNING);
> +
> + if (current->state == TASK_RUNNING)
> + return 1;
> + if (ret < 0 || !spin)
> + break;
> + cpu_relax();
> + } while (!need_resched());
> +
> + __set_current_state(TASK_RUNNING);
> +
> + return 0;
> + }
This needs to be factored out into a helper at least.
next prev parent reply other threads:[~2020-01-31 6:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-26 4:41 [PATCH 0/2] Enable polling on stackable devices Andrzej Jakowski
2020-01-26 4:41 ` [PATCH 1/2] block: introduce polling on bio level Andrzej Jakowski
2020-01-30 4:01 ` Jens Axboe
2020-01-31 6:35 ` Christoph Hellwig
2020-02-01 4:41 ` Jens Axboe
2020-01-31 6:34 ` Christoph Hellwig [this message]
2020-01-31 18:51 ` Andrzej Jakowski
2020-02-01 8:20 ` Christoph Hellwig
2020-01-26 4:41 ` [PATCH 2/2] md: enable io polling Andrzej Jakowski
2020-01-31 6:36 ` Christoph Hellwig
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=20200131063407.GB6267@infradead.org \
--to=hch@infradead.org \
--cc=andrzej.jakowski@linux.intel.com \
--cc=artur.paszkiewicz@intel.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@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;
as well as URLs for NNTP newsgroup(s).