]> git.infradead.org Git - users/hch/misc.git/commitdiff
drm/i915/gem: Suppress oom warning in favour of ENOMEM to userspace
authorNirmoy Das <nirmoy.das@intel.com>
Wed, 26 Jun 2024 14:33:18 +0000 (16:33 +0200)
committerAndi Shyti <andi.shyti@linux.intel.com>
Thu, 27 Jun 2024 22:11:01 +0000 (00:11 +0200)
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
drivers/gpu/drm/i915/i915_scatterlist.c

index e93d2538f2988626c972d160224cefc7d67dafbf..4d830740946da39d9f690bbb1daa86814ea3a1ac 100644 (file)
@@ -90,7 +90,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
 
        GEM_BUG_ON(!max_segment);
 
-       rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
+       rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN);
        if (!rsgt)
                return ERR_PTR(-ENOMEM);
 
@@ -104,7 +104,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
        }
 
        if (sg_alloc_table(st, DIV_ROUND_UP_ULL(node->size, segment_pages),
-                          GFP_KERNEL)) {
+                          GFP_KERNEL | __GFP_NOWARN)) {
                i915_refct_sgt_put(rsgt);
                return ERR_PTR(-ENOMEM);
        }
@@ -178,7 +178,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
        GEM_BUG_ON(list_empty(blocks));
        GEM_BUG_ON(!max_segment);
 
-       rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
+       rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN);
        if (!rsgt)
                return ERR_PTR(-ENOMEM);
 
@@ -190,7 +190,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
                return ERR_PTR(-E2BIG);
        }
 
-       if (sg_alloc_table(st, PFN_UP(res->size), GFP_KERNEL)) {
+       if (sg_alloc_table(st, PFN_UP(res->size), GFP_KERNEL | __GFP_NOWARN)) {
                i915_refct_sgt_put(rsgt);
                return ERR_PTR(-ENOMEM);
        }