From: Greg KH <gregkh@linuxfoundation.org>
To: Giuliano Procida <gprocida@google.com>
Cc: stable@vger.kernel.org,
Jianchao Wang <jianchao.w.wang@oracle.com>,
Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] blk-mq: sync the update nr_hw_queues with blk_mq_queue_tag_busy_iter
Date: Mon, 8 Jun 2020 12:56:17 +0200 [thread overview]
Message-ID: <20200608105617.GA295073@kroah.com> (raw)
In-Reply-To: <20200608094030.87031-1-gprocida@google.com>
On Mon, Jun 08, 2020 at 10:40:30AM +0100, Giuliano Procida wrote:
> From: Jianchao Wang <jianchao.w.wang@oracle.com>
>
> commit f5bbbbe4d63577026f908a809f22f5fd5a90ea1f upstream.
>
> For blk-mq, part_in_flight/rw will invoke blk_mq_in_flight/rw to
> account the inflight requests. It will access the queue_hw_ctx and
> nr_hw_queues w/o any protection. When updating nr_hw_queues and
> blk_mq_in_flight/rw occur concurrently, panic comes up.
>
> Before update nr_hw_queues, the q will be frozen. So we could use
> q_usage_counter to avoid the race. percpu_ref_is_zero is used here
> so that we will not miss any in-flight request. The access to
> nr_hw_queues and queue_hw_ctx in blk_mq_queue_tag_busy_iter are
> under rcu critical section, __blk_mq_update_nr_hw_queues could use
> synchronize_rcu to ensure the zeroed q_usage_counter to be globally
> visible.
>
> Backporting Notes
>
> This is a re-backport, landing synchronize_rcu in the right place.
You sent this twice?
And what stable kernel(s) does it go to?
thanks,
greg k-h
next prev parent reply other threads:[~2020-06-08 10:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 9:40 [PATCH] blk-mq: sync the update nr_hw_queues with blk_mq_queue_tag_busy_iter Giuliano Procida
2020-06-08 10:56 ` Greg KH [this message]
2020-06-08 12:59 ` Giuliano Procida
-- strict thread matches above, loose matches on Subject: below --
2020-06-08 9:39 Giuliano Procida
2020-06-08 13:01 ` Giuliano Procida
2020-06-18 7:27 ` Giuliano Procida
2020-06-18 7:32 ` Greg KH
2020-06-18 9:16 ` Giuliano Procida
2020-06-18 14:59 ` Greg KH
2020-06-18 15:35 ` Giuliano Procida
2020-06-18 16:05 ` Greg KH
2020-06-18 16:14 ` Giuliano Procida
2020-06-18 16:20 ` Greg KH
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=20200608105617.GA295073@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=axboe@kernel.dk \
--cc=gprocida@google.com \
--cc=jianchao.w.wang@oracle.com \
--cc=ming.lei@redhat.com \
--cc=stable@vger.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