Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <andi.shyti@linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240626143318.11600-1-nirmoy.das@intel.com

authored by

Nirmoy Das and committed by
Andi Shyti
3b85152c e22103b9

+4 -4
+4 -4
drivers/gpu/drm/i915/i915_scatterlist.c
··· 90 90 91 91 GEM_BUG_ON(!max_segment); 92 92 93 - rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL); 93 + rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN); 94 94 if (!rsgt) 95 95 return ERR_PTR(-ENOMEM); 96 96 ··· 104 104 } 105 105 106 106 if (sg_alloc_table(st, DIV_ROUND_UP_ULL(node->size, segment_pages), 107 - GFP_KERNEL)) { 107 + GFP_KERNEL | __GFP_NOWARN)) { 108 108 i915_refct_sgt_put(rsgt); 109 109 return ERR_PTR(-ENOMEM); 110 110 } ··· 178 178 GEM_BUG_ON(list_empty(blocks)); 179 179 GEM_BUG_ON(!max_segment); 180 180 181 - rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL); 181 + rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN); 182 182 if (!rsgt) 183 183 return ERR_PTR(-ENOMEM); 184 184 ··· 190 190 return ERR_PTR(-E2BIG); 191 191 } 192 192 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)) { 194 194 i915_refct_sgt_put(rsgt); 195 195 return ERR_PTR(-ENOMEM); 196 196 }