From b27caeb46c9a8a0a023f90abe38fa2738856dc88 Mon Sep 17 00:00:00 2001 From: Ridong Chen Date: Fri, 24 Jul 2026 11:34:33 +0800 Subject: [PATCH] mm: vmscan: propagate real error code from per-node proactive reclaim It has been observed that per-node proactive reclaim always returns -EAGAIN when any error occurs. As discussed in the mailing list [1], the interface should distinguish between cases where no reclaimable memory is left and where another entity is concurrently using the same interface. Propagate the real error code, consistent with how memcg proactive reclaim handles errors. Link: https://lore.kernel.org/20260724033435.2573323-3-ridong.chen@linux.dev Link: https://lore.kernel.org/all/20250717235604.2atyx2aobwowpge3@offworld/T/#m3514718be82a31b05726a49da9b61fbfc69a589e [1] Fixes: b980077899ea ("mm: introduce per-node proactive reclaim interface") Signed-off-by: Ridong Chen Reviewed-by: Muchun Song Acked-by: Johannes Weiner Acked-by: Shakeel Butt Reviewed-by: Qi Zheng Reviewed-by: Barry Song Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: Kairui Song Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Roman Gushchin Cc: Wei Xu Cc: Yuanchu Xie Cc: Zhongkun He Cc: Baolin Wang Signed-off-by: Andrew Morton --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index af0c42daa77d..b93bca48359a 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -8026,7 +8026,7 @@ static ssize_t reclaim_store(struct device *dev, int ret, nid = dev->id; ret = user_proactive_reclaim((char *)buf, NULL, NODE_DATA(nid)); - return ret ? -EAGAIN : count; + return ret ? ret : count; } static DEVICE_ATTR_WO(reclaim);