diff mbox series

drm/ttm: stop warning on TT shrinker failure v2

Message ID 20210322112206.4574-1-christian.koenig@amd.com (mailing list archive)
State New, archived
Headers show
Series drm/ttm: stop warning on TT shrinker failure v2 | expand

Commit Message

Christian König March 22, 2021, 11:22 a.m. UTC
Don't print a warning when we fail to allocate a page for swapping things out.

v2: only stop the warning

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter March 22, 2021, 1:36 p.m. UTC | #1
On Mon, Mar 22, 2021 at 12:22 PM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Don't print a warning when we fail to allocate a page for swapping things out.
>
> v2: only stop the warning
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

It is kinda surprising that page allocator warns here even though we
explicitly asked for non-GFP_KERNEL (which is the only one where you
pretty much can assume you will get memory no matter what, since worst
case the OOM killer makes space for you).

But then with memalloc_no* and friends these failures could happen in
unexpected places, and I think the code that warns isn't aware of the
original gfp flags, so makes some sense from an implementation pov.
-Daniel


> ---
>  drivers/gpu/drm/ttm/ttm_tt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 2f0833c98d2c..48b9a650630b 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -369,7 +369,7 @@ static unsigned long ttm_tt_shrinker_scan(struct shrinker *shrink,
>         };
>         int ret;
>
> -       ret = ttm_bo_swapout(&ctx, GFP_NOFS);
> +       ret = ttm_bo_swapout(&ctx, GFP_NOFS | __GFP_NOWARN);
>         return ret < 0 ? SHRINK_EMPTY : ret;
>  }
>
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 2f0833c98d2c..48b9a650630b 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -369,7 +369,7 @@  static unsigned long ttm_tt_shrinker_scan(struct shrinker *shrink,
 	};
 	int ret;
 
-	ret = ttm_bo_swapout(&ctx, GFP_NOFS);
+	ret = ttm_bo_swapout(&ctx, GFP_NOFS | __GFP_NOWARN);
 	return ret < 0 ? SHRINK_EMPTY : ret;
 }