From: Ming Lei <ming.lei@redhat.com>
To: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] null_blk: allow zero poll queues
Date: Fri, 3 Dec 2021 20:07:04 +0800 [thread overview]
Message-ID: <YaoIaAMSut0UGhy1@T590> (raw)
In-Reply-To: <20211203100133.gdut65jrb6z6eodr@shindev>
Hi Shinichiro,
On Fri, Dec 03, 2021 at 10:01:33AM +0000, Shinichiro Kawasaki wrote:
> On Dec 03, 2021 / 10:39, Ming Lei wrote:
> > There isn't any reason to not allow zero poll queues from user
> > viewpoint.
> >
> > Also sometimes we need to compare io poll between poll mode and irq
> > mode, so not allowing poll queues is bad.
> >
> > Fixes: 15dfc662ef31 ("null_blk: Fix handling of submit_queues and poll_queues attributes")
> > Cc: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> > Signed-off-by: Ming Lei <ming.lei@redhat.com>
>
> Hi Ming,
>
> It is good to know that the zero poll queues is useful. Having said that, I
> observe zero division error [1] with your patch and the commands below. Don' we
> need some more code changes to avoid the error?
>
> # modprobe null_blk
> # cd /sys/kernel/config/nullb
> # mkdir test
> # echo 0 > test/poll_queues
> # echo 1 > test/power
> Segmentation fault
I guess the following change may fix the error:
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 20534a2daf17..96c55d06401d 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1892,7 +1892,7 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)
if (g_shared_tag_bitmap)
set->flags |= BLK_MQ_F_TAG_HCTX_SHARED;
set->driver_data = nullb;
- if (g_poll_queues)
+ if (poll_queues)
set->nr_maps = 3;
else
set->nr_maps = 1;
Thanks,
Ming
next prev parent reply other threads:[~2021-12-03 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 2:39 [PATCH] null_blk: allow zero poll queues Ming Lei
2021-12-03 2:57 ` Jens Axboe
2021-12-03 10:01 ` Shinichiro Kawasaki
2021-12-03 12:07 ` Ming Lei [this message]
2021-12-04 1:34 ` Shinichiro Kawasaki
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=YaoIaAMSut0UGhy1@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox