Skip to content

Commit e00f4f4

Browse files
htejunaxboe
authored andcommitted
block,blkcg: use __GFP_NOWARN for best-effort allocations in blkcg
blkcg allocates some per-cgroup data structures with GFP_NOWAIT and when that fails falls back to operations which aren't specific to the cgroup. Occassional failures are expected under pressure and falling back to non-cgroup operation is the right thing to do. Unfortunately, I forgot to add __GFP_NOWARN to these allocations and these expected failures end up creating a lot of noise. Add __GFP_NOWARN. Signed-off-by: Tejun Heo <[email protected]> Reported-by: Marc MERLIN <[email protected]> Reported-by: Vlastimil Babka <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 05aea81 commit e00f4f4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

block/blk-cgroup.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,16 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
185185
}
186186

187187
wb_congested = wb_congested_get_create(&q->backing_dev_info,
188-
blkcg->css.id, GFP_NOWAIT);
188+
blkcg->css.id,
189+
GFP_NOWAIT | __GFP_NOWARN);
189190
if (!wb_congested) {
190191
ret = -ENOMEM;
191192
goto err_put_css;
192193
}
193194

194195
/* allocate */
195196
if (!new_blkg) {
196-
new_blkg = blkg_alloc(blkcg, q, GFP_NOWAIT);
197+
new_blkg = blkg_alloc(blkcg, q, GFP_NOWAIT | __GFP_NOWARN);
197198
if (unlikely(!new_blkg)) {
198199
ret = -ENOMEM;
199200
goto err_put_congested;
@@ -1022,7 +1023,7 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css)
10221023
}
10231024

10241025
spin_lock_init(&blkcg->lock);
1025-
INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_NOWAIT);
1026+
INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_NOWAIT | __GFP_NOWARN);
10261027
INIT_HLIST_HEAD(&blkcg->blkg_list);
10271028
#ifdef CONFIG_CGROUP_WRITEBACK
10281029
INIT_LIST_HEAD(&blkcg->cgwb_list);
@@ -1240,7 +1241,7 @@ int blkcg_activate_policy(struct request_queue *q,
12401241
if (blkg->pd[pol->plid])
12411242
continue;
12421243

1243-
pd = pol->pd_alloc_fn(GFP_NOWAIT, q->node);
1244+
pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q->node);
12441245
if (!pd)
12451246
swap(pd, pd_prealloc);
12461247
if (!pd) {

block/cfq-iosched.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3859,7 +3859,8 @@ cfq_get_queue(struct cfq_data *cfqd, bool is_sync, struct cfq_io_cq *cic,
38593859
goto out;
38603860
}
38613861

3862-
cfqq = kmem_cache_alloc_node(cfq_pool, GFP_NOWAIT | __GFP_ZERO,
3862+
cfqq = kmem_cache_alloc_node(cfq_pool,
3863+
GFP_NOWAIT | __GFP_ZERO | __GFP_NOWARN,
38633864
cfqd->queue->node);
38643865
if (!cfqq) {
38653866
cfqq = &cfqd->oom_cfqq;

0 commit comments

Comments
 (0)