mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 02:36:21 +00:00
block: async_bio_lock does not need to be bh-safe
async_bio_lock is only taken from bio submission and workqueue context, both are never in bottom halves. Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
3480373ebd
commit
12be09fe18
@ -198,10 +198,10 @@ static void blkg_async_bio_workfn(struct work_struct *work)
|
|||||||
bool need_plug = false;
|
bool need_plug = false;
|
||||||
|
|
||||||
/* as long as there are pending bios, @blkg can't go away */
|
/* as long as there are pending bios, @blkg can't go away */
|
||||||
spin_lock_bh(&blkg->async_bio_lock);
|
spin_lock(&blkg->async_bio_lock);
|
||||||
bio_list_merge(&bios, &blkg->async_bios);
|
bio_list_merge(&bios, &blkg->async_bios);
|
||||||
bio_list_init(&blkg->async_bios);
|
bio_list_init(&blkg->async_bios);
|
||||||
spin_unlock_bh(&blkg->async_bio_lock);
|
spin_unlock(&blkg->async_bio_lock);
|
||||||
|
|
||||||
/* start plug only when bio_list contains at least 2 bios */
|
/* start plug only when bio_list contains at least 2 bios */
|
||||||
if (bios.head && bios.head->bi_next) {
|
if (bios.head && bios.head->bi_next) {
|
||||||
@ -1699,9 +1699,9 @@ void blkcg_punt_bio_submit(struct bio *bio)
|
|||||||
struct blkcg_gq *blkg = bio->bi_blkg;
|
struct blkcg_gq *blkg = bio->bi_blkg;
|
||||||
|
|
||||||
if (blkg->parent) {
|
if (blkg->parent) {
|
||||||
spin_lock_bh(&blkg->async_bio_lock);
|
spin_lock(&blkg->async_bio_lock);
|
||||||
bio_list_add(&blkg->async_bios, bio);
|
bio_list_add(&blkg->async_bios, bio);
|
||||||
spin_unlock_bh(&blkg->async_bio_lock);
|
spin_unlock(&blkg->async_bio_lock);
|
||||||
queue_work(blkcg_punt_bio_wq, &blkg->async_bio_work);
|
queue_work(blkcg_punt_bio_wq, &blkg->async_bio_work);
|
||||||
} else {
|
} else {
|
||||||
/* never bounce for the root cgroup */
|
/* never bounce for the root cgroup */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user