From: Daniel Wagner <dwagner@suse.de>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Ming Lei <ming.lei@redhat.com>, Hannes Reinecke <hare@suse.de>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>,
John Garry <john.garry@huawei.com>,
Khazhy Kumykov <khazhy@google.com>
Subject: Re: [PATCH v6 2/5] blk-mq: Introduce atomic variants of blk_mq_(all_tag|tagset_busy)_iter
Date: Tue, 13 Apr 2021 09:50:24 +0200 [thread overview]
Message-ID: <20210413075024.xivnj3jy6olaqglc@beryllium.lan> (raw)
In-Reply-To: <20210406214905.21622-3-bvanassche@acm.org>
On Tue, Apr 06, 2021 at 02:49:02PM -0700, Bart Van Assche wrote:
> Since in the next patch knowledge is required of whether or not it is
> allowed to sleep inside the tag iteration functions, pass this context
> information to the tag iteration functions. I have reviewed all callers of
> tag iteration functions to verify these annotations by starting from the
> output of the following grep command:
>
> git grep -nHE 'blk_mq_(all_tag|tagset_busy)_iter'
>
> My conclusions from that analysis are as follows:
> - Sleeping is allowed in the blk-mq-debugfs code that iterates over tags.
> - Since the blk_mq_tagset_busy_iter() calls in the mtip32xx driver are
> preceded by a function that sleeps (blk_mq_quiesce_queue()), sleeping is
> safe in the context of the blk_mq_tagset_busy_iter() calls.
> - The same reasoning also applies to the nbd driver.
> - All blk_mq_tagset_busy_iter() calls in the NVMe drivers are followed by a
> call to a function that sleeps so sleeping inside blk_mq_tagset_busy_iter()
> when called from the NVMe driver is fine.
> - scsi_host_busy(), scsi_host_complete_all_commands() and
> scsi_host_busy_iter() are used by multiple SCSI LLDs so analyzing whether
> or not these functions may sleep is hard. Instead of performing that
> analysis, make it safe to call these functions from atomic context.
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
> Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Khazhy Kumykov <khazhy@google.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Maybe you could also annotate blk_mq_all_tag_iter() with a
might_sleep(). This would help to find API abusers more easily.
Reviewed-by: Daniel Wagner <dwagner@suse.de>
next prev parent reply other threads:[~2021-04-13 7:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 21:49 [PATCH v6 0/5] blk-mq: Fix a race between iterating over requests and freeing requests Bart Van Assche
2021-04-06 21:49 ` [PATCH v6 1/5] blk-mq: Move the elevator_exit() definition Bart Van Assche
2021-04-07 15:36 ` John Garry
2021-04-20 21:30 ` Bart Van Assche
2021-04-13 7:44 ` Daniel Wagner
2021-04-06 21:49 ` [PATCH v6 2/5] blk-mq: Introduce atomic variants of blk_mq_(all_tag|tagset_busy)_iter Bart Van Assche
2021-04-07 16:57 ` John Garry
2021-04-07 18:42 ` Bart Van Assche
2021-04-08 12:48 ` John Garry
2021-04-08 16:12 ` Bart Van Assche
2021-04-08 16:35 ` John Garry
2021-04-13 7:50 ` Daniel Wagner [this message]
2021-04-20 21:35 ` Bart Van Assche
2021-04-21 7:25 ` Daniel Wagner
2021-04-06 21:49 ` [PATCH v6 3/5] blk-mq: Fix races between iterating over requests and freeing requests Bart Van Assche
2021-04-07 0:02 ` Khazhy Kumykov
2021-04-07 21:54 ` Bart Van Assche
2021-04-20 21:41 ` Bart Van Assche
2021-04-06 21:49 ` [PATCH v6 4/5] blk-mq: Make it safe to use RCU to iterate over blk_mq_tag_set.tag_list Bart Van Assche
2021-04-06 21:49 ` [PATCH v6 5/5] blk-mq: Fix races between blk_mq_update_nr_hw_queues() and iterating over tags Bart Van Assche
2021-04-07 0:04 ` Khazhy Kumykov
2021-04-08 6:45 ` [PATCH v6 0/5] blk-mq: Fix a race between iterating over requests and freeing requests Shinichiro Kawasaki
2021-04-20 21:55 ` Bart Van Assche
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=20210413075024.xivnj3jy6olaqglc@beryllium.lan \
--to=dwagner@suse.de \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=johannes.thumshirn@wdc.com \
--cc=john.garry@huawei.com \
--cc=khazhy@google.com \
--cc=linux-block@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).