Skip to content

Commit 8ff6926

Browse files
YuKuai-huaweikawasaki
authored andcommitted
blk-cgroup: allocate policy data with GFP_NOIO in blkcg_activate_policy()
Queue is freezed while activating policy, allocate memory with queue freezed has the risk of deadlock because memory reclaim can issue new IO. Signed-off-by: Yu Kuai <[email protected]>
1 parent 4819bfd commit 8ff6926

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

block/blk-cgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
16361636
if (!pd) {
16371637
/*
16381638
* GFP_NOWAIT failed. Free the existing one and
1639-
* prealloc for @blkg w/ GFP_KERNEL.
1639+
* prealloc for @blkg w/ GFP_NOIO.
16401640
*/
16411641
if (pinned_blkg)
16421642
blkg_put(pinned_blkg);
@@ -1648,7 +1648,7 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
16481648
if (pd_prealloc)
16491649
pol->pd_free_fn(pd_prealloc);
16501650
pd_prealloc = pol->pd_alloc_fn(disk, blkg->blkcg,
1651-
GFP_KERNEL);
1651+
GFP_NOIO);
16521652
if (pd_prealloc)
16531653
goto retry;
16541654
else

0 commit comments

Comments
 (0)