From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Daniel Wagner <dwagner@suse.de>,
Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH v7 0/5] blk-mq: Fix a race between iterating over requests and freeing requests
Date: Tue, 20 Apr 2021 17:02:30 -0700 [thread overview]
Message-ID: <20210421000235.2028-1-bvanassche@acm.org> (raw)
Hi Jens,
This patch series fixes the race between iterating over requests and
freeing requests that has been reported by multiple different users over
the past two years. Please consider this patch series for kernel v5.13.
Thanks,
Bart.
Changes between v6 and v7:
- Changed one comment.
- Updated Reviewed-by / Tested-by tags.
Changes between v5 and v6:
- Fixed an additional race between iterating over tags and freeing scheduler
requests that was spotted by Khazhy.
- Added two patches to fix the race conditions between updating the number of
hardware queues and iterating over a tag set.
Changes between v4 and v5:
- Addressed Khazhy's review comments. Note: the changes that have been made
in v5 only change behavior in case CONFIG_PROVE_RCU=y.
Changes between v3 and v4:
- Fixed support for tag sets shared across hardware queues.
- Renamed blk_mq_wait_for_tag_readers() into blk_mq_wait_for_tag_iter().
- Removed the fourth argument of blk_mq_queue_tag_busy_iter() again.
Changes between v2 and v3:
- Converted the single v2 patch into a series of three patches.
- Switched from SRCU to a combination of RCU and semaphores.
Changes between v1 and v2:
- Reformatted patch description.
- Added Tested-by/Reviewed-by tags.
- Changed srcu_barrier() calls into synchronize_srcu() calls.
Bart Van Assche (5):
blk-mq: Move the elevator_exit() definition
blk-mq: Introduce atomic variants of blk_mq_(all_tag|tagset_busy)_iter
blk-mq: Fix races between iterating over requests and freeing requests
blk-mq: Make it safe to use RCU to iterate over
blk_mq_tag_set.tag_list
blk-mq: Fix races between blk_mq_update_nr_hw_queues() and iterating
over tags
block/blk-core.c | 34 +++++++++-
block/blk-mq-tag.c | 128 ++++++++++++++++++++++++++++++++++----
block/blk-mq-tag.h | 6 +-
block/blk-mq.c | 31 ++++++---
block/blk-mq.h | 1 +
block/blk.h | 11 +---
block/elevator.c | 9 +++
drivers/scsi/hosts.c | 16 ++---
drivers/scsi/ufs/ufshcd.c | 4 +-
include/linux/blk-mq.h | 2 +
10 files changed, 202 insertions(+), 40 deletions(-)
next reply other threads:[~2021-04-21 0:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 0:02 Bart Van Assche [this message]
2021-04-21 0:02 ` [PATCH v7 1/5] blk-mq: Move the elevator_exit() definition Bart Van Assche
2021-04-21 0:02 ` [PATCH v7 2/5] blk-mq: Introduce atomic variants of blk_mq_(all_tag|tagset_busy)_iter Bart Van Assche
2021-04-21 0:02 ` [PATCH v7 3/5] blk-mq: Fix races between iterating over requests and freeing requests Bart Van Assche
2021-04-22 2:25 ` Ming Lei
2021-04-22 4:01 ` Bart Van Assche
2021-04-22 7:23 ` Ming Lei
2021-04-22 3:15 ` Ming Lei
2021-04-22 3:54 ` Bart Van Assche
2021-04-22 7:13 ` Ming Lei
2021-04-22 15:51 ` Bart Van Assche
2021-04-23 3:52 ` Ming Lei
2021-04-23 17:52 ` Bart Van Assche
2021-04-25 0:09 ` Ming Lei
2021-04-25 21:01 ` Bart Van Assche
2021-04-26 0:55 ` Ming Lei
2021-04-26 16:29 ` Bart Van Assche
2021-04-27 0:11 ` Ming Lei
2021-04-21 0:02 ` [PATCH v7 4/5] blk-mq: Make it safe to use RCU to iterate over blk_mq_tag_set.tag_list Bart Van Assche
2021-04-21 0:02 ` [PATCH v7 5/5] blk-mq: Fix races between blk_mq_update_nr_hw_queues() and iterating over tags Bart Van Assche
2021-04-21 14:40 ` [PATCH v7 0/5] blk-mq: Fix a race between iterating over requests and freeing requests Jens Axboe
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=20210421000235.2028-1-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=dwagner@suse.de \
--cc=hch@lst.de \
--cc=linux-block@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;
as well as URLs for NNTP newsgroup(s).