From: yuyufen <yuyufen@huawei.com>
To: <axboe@kernel.dk>, <Damien.LeMoal@wdc.com>,
<marcos.souza.org@gmail.com>, <linux-block@vger.kernel.org>
Subject: Re: [PATCH v2] block: add a new flag BLK_MQ_POLL_CLASSIC for hybrid poll
Date: Mon, 11 Mar 2019 21:31:09 +0800 [thread overview]
Message-ID: <68a8b534-9eb8-7309-4df8-a90ea5705e49@huawei.com> (raw)
In-Reply-To: <20190301012855.137660-1-yuyufen@huawei.com>
ping?
On 2019/3/1 9:28, Yufen Yu wrote:
> For q->poll_nsec == -1, means doing classic poll, not hybrid poll.
> We introduce a new flag BLK_MQ_POLL_CLASSIC to replace -1, which
> may make code much easier to read.
>
> Signed-off-by: Yufen Yu <yuyufen@huawei.com>
> ---
> block/blk-mq.c | 4 ++--
> block/blk-sysfs.c | 4 ++--
> include/linux/blkdev.h | 3 +++
> 3 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 9437a5eb07cf..e70202e3b378 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2857,7 +2857,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
> /*
> * Default to classic polling
> */
> - q->poll_nsec = -1;
> + q->poll_nsec = BLK_MQ_POLL_CLASSIC;
>
> blk_mq_init_cpu_queues(q, set->nr_hw_queues);
> blk_mq_add_queue_tag_set(set, q);
> @@ -3389,7 +3389,7 @@ static bool blk_mq_poll_hybrid(struct request_queue *q,
> {
> struct request *rq;
>
> - if (q->poll_nsec == -1)
> + if (q->poll_nsec == BLK_MQ_POLL_CLASSIC)
> return false;
>
> if (!blk_qc_t_is_internal(cookie))
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index 590d1ef2f961..8639e135687e 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -360,7 +360,7 @@ static ssize_t queue_poll_delay_show(struct request_queue *q, char *page)
> {
> int val;
>
> - if (q->poll_nsec == -1)
> + if (q->poll_nsec == BLK_MQ_POLL_CLASSIC)
> val = -1;
> else
> val = q->poll_nsec / 1000;
> @@ -381,7 +381,7 @@ static ssize_t queue_poll_delay_store(struct request_queue *q, const char *page,
> return err;
>
> if (val == -1)
> - q->poll_nsec = -1;
> + q->poll_nsec = BLK_MQ_POLL_CLASSIC;
> else
> q->poll_nsec = val * 1000;
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 338604dff7d0..f9c2ebf5e621 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -50,6 +50,9 @@ struct blk_stat_callback;
> /* Must be consistent with blk_mq_poll_stats_bkt() */
> #define BLK_MQ_POLL_STATS_BKTS 16
>
> +/* Doing classic polling */
> +#define BLK_MQ_POLL_CLASSIC -1
> +
> /*
> * Maximum number of blkcg policies allowed to be registered concurrently.
> * Defined here to simplify include dependency.
next prev parent reply other threads:[~2019-03-11 13:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 1:28 [PATCH v2] block: add a new flag BLK_MQ_POLL_CLASSIC for hybrid poll Yufen Yu
2019-03-11 13:31 ` yuyufen [this message]
2019-03-11 13:51 ` Damien Le Moal
2019-03-15 3:20 ` yuyufen
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=68a8b534-9eb8-7309-4df8-a90ea5705e49@huawei.com \
--to=yuyufen@huawei.com \
--cc=Damien.LeMoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=marcos.souza.org@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.