Skip to content

blk-cgroup: fix blkg list and policy data races

Yu Kuai cgroups linux-block lkml 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest posting 2/20 of 4 patches 0 repliesNew
  2. v4 posting 1/24 patches 7 repliesApplied
  3. v34 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v24 patches7 repliesSuperseded

Changes in v4 from the cover letter

- Rebase on the latest for-7.3/block branch.

Patches in v4 posting 2/2 No applies recorded yet

None of the 4 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/4] blk-cgroup: fix blkg list and policy data races

From: Yu Kuai <[email protected]>

This set fix some problems that are reported long time ago with minimal changes, the blkcg_mutex refactor I'm working on can fix these problems as well, but it's complicated and may not land in this merge window. So I think this set should land in this merge window first.

Patch 1 protects blkg_destroy_all()'s q->blkg_list walk with blkcg_mutex.

Patches 2-3 fix races between blkcg_activate_policy() and concurrent blkg destruction.

Patch 4 factors the policy data teardown loop into a helper after the race fixes.

Changes since v3:
- Rebase on the latest for-7.3/block branch.

Changes since v2:
- Rebase on the latest block-7.2 branch.

Changes since v1:
- Drop the BFQ q->blkg_list patch because the current block tree already has a stronger fix in commit 17b2d950a3c0 ("block, bfq: protect async queue reset with blkcg locks").
- Add Reviewed-by tags from Tang Yizhou.

Yu Kuai (1):
blk-cgroup: protect q->blkg_list iteration in blkg_destroy_all() with
blkcg_mutex

Zheng Qixing (3):
blk-cgroup: fix race between policy activation and blkg destruction
blk-cgroup: skip dying blkg in blkcg_activate_policy()
blk-cgroup: factor policy pd teardown loop into helper

 block/blk-cgroup.c | 65 +++++++++++++++++++++++++---------------------
 1 file changed, 35 insertions(+), 30 deletions(-)
Signature · 1 line
2.51.0