Skip to content

Commit a8c18be

Browse files
icklematt-auld
authored andcommitted
drm/i915: Suppress oom warning for shmemfs object allocation failure
We report object allocation failures to userspace with ENOMEM, yet we still show the memory warning after failing to shrink device allocated pages. While this warning is similar to other system page allocation failures, it is superfluous to the ENOMEM provided directly to userspace. v2: Add NOWARN in few more places from where we might return ENOMEM to userspace. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4936 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Co-developed-by: Nirmoy Das <nirmoy.das@intel.com> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220727174023.16766-1-nirmoy.das@intel.com
1 parent b25c377 commit a8c18be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/i915/gem/i915_gem_shmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int shmem_sg_alloc_table(struct drm_i915_private *i915, struct sg_table *st,
7575
if (size > resource_size(&mr->region))
7676
return -ENOMEM;
7777

78-
if (sg_alloc_table(st, page_count, GFP_KERNEL))
78+
if (sg_alloc_table(st, page_count, GFP_KERNEL | __GFP_NOWARN))
7979
return -ENOMEM;
8080

8181
/*
@@ -137,7 +137,7 @@ int shmem_sg_alloc_table(struct drm_i915_private *i915, struct sg_table *st,
137137
* trigger the out-of-memory killer and for
138138
* this we want __GFP_RETRY_MAYFAIL.
139139
*/
140-
gfp |= __GFP_RETRY_MAYFAIL;
140+
gfp |= __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
141141
}
142142
} while (1);
143143

@@ -209,7 +209,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
209209
GEM_BUG_ON(obj->write_domain & I915_GEM_GPU_DOMAINS);
210210

211211
rebuild_st:
212-
st = kmalloc(sizeof(*st), GFP_KERNEL);
212+
st = kmalloc(sizeof(*st), GFP_KERNEL | __GFP_NOWARN);
213213
if (!st)
214214
return -ENOMEM;
215215

0 commit comments

Comments
 (0)