|
|
Subscribe / Log in / New account

blk-cgroup: don't use queue_lock for protection and fix deadlock

From:  Yu Kuai <yukuai1-AT-huaweicloud.com>
To:  tj-AT-kernel.org, ming.lei-AT-redhat.com, nilay-AT-linux.ibm.com, hch-AT-lst.de, josef-AT-toxicpanda.com, axboe-AT-kernel.dk, akpm-AT-linux-foundation.org, vgoyal-AT-redhat.com
Subject:  [PATCH 00/10] blk-cgroup: don't use queue_lock for protection and fix deadlock
Date:  Thu, 25 Sep 2025 16:15:15 +0800
Message-ID:  <20250925081525.700639-1-yukuai1@huaweicloud.com>
Cc:  cgroups-AT-vger.kernel.org, linux-block-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-mm-AT-kvack.org, yukuai3-AT-huawei.com, yukuai1-AT-huaweicloud.com, yi.zhang-AT-huawei.com, yangerkun-AT-huawei.com, johnny.chenyi-AT-huawei.com
Archive-link:  Article

From: Yu Kuai <yukuai3@huawei.com>

patch 1-6 is prep patches to make sure queue_lock is not nested under
rcu and other spinlocks in blk-cgroup;
patch 7 convert blk-cgroup to use blkcg_mutex to protect blkgs;
patch 8-9 are follow cleanups;
patch 10 fix deadlock in blk-throttle;

BTW, with this set, we can unify blkg_conf_prep() and other related
helpers.

Yu Kuai (10):
  blk-cgroup: use cgroup lock and rcu to protect iterating blkcg blkgs
  blk-cgroup: don't nest queue_lock under rcu in blkg_lookup_create()
  blk-cgroup: don't nest queu_lock under rcu in bio_associate_blkg()
  blk-cgroup: don't nest queue_lock under blkcg->lock in
    blkcg_destroy_blkgs()
  mm/page_io: don't nest queue_lock under rcu in
    bio_associate_blkg_from_page()
  block, bfq: don't grab queue_lock to initialize bfq
  blk-cgroup: convert to protect blkgs with blkcg_mutex
  blk-cgroup: remove radix_tree_preload()
  blk-cgroup: remove preallocate blkg for blkg_create()
  blk-throttle: fix possible deadlock due to queue_lock in timer

 block/bfq-cgroup.c        |   6 +-
 block/bfq-iosched.c       |  13 +-
 block/blk-cgroup-rwstat.c |   2 -
 block/blk-cgroup.c        | 329 ++++++++++++++++----------------------
 block/blk-cgroup.h        |   6 +-
 block/blk-throttle.c      |  31 ++--
 mm/page_io.c              |   7 +-
 7 files changed, 163 insertions(+), 231 deletions(-)

-- 
2.39.2




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds