History

blkcg: don't offline parent blkcg first

blkcg->cgwb_refcnt is used to delay blkcg offlining so that blkgs don't get offlined while there are active cgwbs on them. However, it ends up making offlining unordered sometimes causing parents to be offlined before children. Let's fix this by making child blkcgs pin the parents' online states. Note that pin/unpin names are chosen over get/put intentionally because css uses get/put online for something different.

Tejun Heo committed 7 years ago

Commit 4308a431 parent d866dbf2 files · +21 −1Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/blk-cgroup.h+5−1
@@ -436,8 +436,12 @@ static inline void blkcg_pin_online(struct blkcg *blkcg) · 435 unmodified lines
436436 */
437437 static inline void blkcg_unpin_online(struct blkcg *blkcg)
438438 {
439− if (refcount_dec_and_test(&blkcg->online_pin))
439+ do {
440+ if (!refcount_dec_and_test(&blkcg->online_pin))
441+ break;
440442 blkcg_destroy_blkgs(blkcg);
443+ blkcg = blkcg_parent(blkcg);
444+ } while (blkcg);
441445 }
442446
443447 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t