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

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/shrinker: Fix can_block() logic

The intention here was to allow blocking if DIRECT_RECLAIM or if called
from kswapd and KSWAPD_RECLAIM is set.

Reported by Claude code review: https://lore.gitlab.freedesktop.org/drm-ai-reviews/review-patch9-20260309151119.290217-10-boris.brezillon@collabora.com/ on a panthor patch which had copied similar logic.

Reported-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 7860d720a84c ("drm/msm: Fix build break with recent mm tree")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Patchwork: https://patchwork.freedesktop.org/patch/714238/
Message-ID: <20260325184106.1259528-1-robin.clark@oss.qualcomm.com>

Rob Clark df0f439e c289a6db

+2 -3
+2 -3
drivers/gpu/drm/msm/msm_gem_shrinker.c
··· 26 26 27 27 static bool can_block(struct shrink_control *sc) 28 28 { 29 - if (!(sc->gfp_mask & __GFP_DIRECT_RECLAIM)) 30 - return false; 31 - return current_is_kswapd() || (sc->gfp_mask & __GFP_RECLAIM); 29 + return (sc->gfp_mask & __GFP_DIRECT_RECLAIM) || 30 + (current_is_kswapd() && (sc->gfp_mask & __GFP_KSWAPD_RECLAIM)); 32 31 } 33 32 34 33 static unsigned long