From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Ming Lei <ming.lei@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
Hannes Reinecke <hare@suse.com>,
Greg KH <gregkh@linuxfoundation.org>,
Mike Snitzer <snitzer@redhat.com>,
Bart Van Assche <bvanassche@acm.org>,
Damien Le Moal <damien.lemoal@wdc.com>
Subject: [PATCH V4 0/5] block: don't acquire .sysfs_lock before removing mq & iosched kobjects
Date: Tue, 27 Aug 2019 19:01:43 +0800 [thread overview]
Message-ID: <20190827110148.808-1-ming.lei@redhat.com> (raw)
Hi,
The 1st 3 patches cleans up current uses on q->sysfs_lock.
The 4th patch adds one helper for checking if queue is registered.
The last patch splits .sysfs_lock into two locks: one is only for
sync .store/.show from sysfs, the other one is for pretecting kobjects
registering/unregistering. Meantime avoid to acquire .sysfs_lock when
removing mq & iosched kobjects, so that the reported deadlock can
be fixed.
V4:
- address comments from Bart
- update comments, add comments about releasing sysfs_lock in elevator_switch_mq
- fix a race in blk_register_queue by holding sysfs_lock for
emitting KOBJ_ADD
- only the 5th patch is updated
V3:
- drop the 4th patch in V2, which is wrong, meantime not necesary
for fixing this deadlock
- replace comment with one WARN_ON_ONCE() in patch 2
- add reviewed-by tag
V2:
- remove several uses on .sysfs_lock
- Remove blk_mq_register_dev()
- add one helper for checking queue registered
- split .sysfs_lock into two locks
Bart Van Assche (1):
block: Remove blk_mq_register_dev()
Ming Lei (4):
block: don't hold q->sysfs_lock in elevator_init_mq
blk-mq: don't hold q->sysfs_lock in blk_mq_map_swqueue
block: add helper for checking if queue is registered
block: split .sysfs_lock into two locks
block/blk-core.c | 1 +
block/blk-mq-sysfs.c | 23 ++++----------
block/blk-mq.c | 7 -----
block/blk-sysfs.c | 50 +++++++++++++++++------------
block/blk-wbt.c | 2 +-
block/blk.h | 2 +-
block/elevator.c | 71 +++++++++++++++++++++++++++++++-----------
include/linux/blk-mq.h | 1 -
include/linux/blkdev.h | 2 ++
9 files changed, 94 insertions(+), 65 deletions(-)
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
--
2.20.1
next reply other threads:[~2019-08-27 11:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 11:01 Ming Lei [this message]
2019-08-27 11:01 ` [PATCH V4 1/5] block: Remove blk_mq_register_dev() Ming Lei
2019-08-27 11:01 ` [PATCH V4 2/5] block: don't hold q->sysfs_lock in elevator_init_mq Ming Lei
2019-08-27 11:01 ` [PATCH V4 3/5] blk-mq: don't hold q->sysfs_lock in blk_mq_map_swqueue Ming Lei
2019-08-27 11:01 ` [PATCH V4 4/5] block: add helper for checking if queue is registered Ming Lei
2019-08-27 11:01 ` [PATCH V4 5/5] block: split .sysfs_lock into two locks Ming Lei
2019-08-27 16:37 ` Bart Van Assche
2019-08-27 16:40 ` [PATCH V4 0/5] block: don't acquire .sysfs_lock before removing mq & iosched kobjects 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=20190827110148.808-1-ming.lei@redhat.com \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=damien.lemoal@wdc.com \
--cc=gregkh@linuxfoundation.org \
--cc=hare@suse.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=snitzer@redhat.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).