Skip to content

Commit 3b85152

Browse files
nirmoyAndi Shyti
authored andcommitted
drm/i915/gem: Suppress oom warning in favour of ENOMEM to userspace
We report object allocation failures to userspace with ENOMEM so add __GFP_NOWARN to remove superfluous oom warnings. Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4936 Cc: Andi Shyti <[email protected]> Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e22103b commit 3b85152

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/i915/i915_scatterlist.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
9090

9191
GEM_BUG_ON(!max_segment);
9292

93-
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
93+
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN);
9494
if (!rsgt)
9595
return ERR_PTR(-ENOMEM);
9696

@@ -104,7 +104,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
104104
}
105105

106106
if (sg_alloc_table(st, DIV_ROUND_UP_ULL(node->size, segment_pages),
107-
GFP_KERNEL)) {
107+
GFP_KERNEL | __GFP_NOWARN)) {
108108
i915_refct_sgt_put(rsgt);
109109
return ERR_PTR(-ENOMEM);
110110
}
@@ -178,7 +178,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
178178
GEM_BUG_ON(list_empty(blocks));
179179
GEM_BUG_ON(!max_segment);
180180

181-
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
181+
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN);
182182
if (!rsgt)
183183
return ERR_PTR(-ENOMEM);
184184

@@ -190,7 +190,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
190190
return ERR_PTR(-E2BIG);
191191
}
192192

193-
if (sg_alloc_table(st, PFN_UP(res->size), GFP_KERNEL)) {
193+
if (sg_alloc_table(st, PFN_UP(res->size), GFP_KERNEL | __GFP_NOWARN)) {
194194
i915_refct_sgt_put(rsgt);
195195
return ERR_PTR(-ENOMEM);
196196
}

0 commit comments

Comments
 (0)