Re: [PATCH 2/3] mm: vmscan: propagate real error code from per-node proactive reclaim
From: Muchun Song
Date: Fri Jul 17 2026 - 09:03:22 EST
> On Jul 17, 2026, at 19:32, Ridong <ridong.chen@xxxxxxxxx> wrote:
>
> From: Ridong Chen <chenridong@xxxxxxxxxx>
>
> 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.
>
> [1] https://lore.kernel.org/all/20250717235604.2atyx2aobwowpge3@offworld/T/#m3514718be82a31b05726a49da9b61fbfc69a589e
>
> Fixes: b980077899ea ("mm: introduce per-node proactive reclaim interface")
> Signed-off-by: Ridong Chen <chenridong@xxxxxxxxxx>
Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>
> ---
> mm/vmscan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 098adc599720..45fbbefe0906 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -8008,7 +8008,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;
I usually use "? :" to omit ret. Just to be clear, I'm only sharing this
as a personal preference. I'm not suggesting that you actually need to change
it.
> }
>
> static DEVICE_ATTR_WO(reclaim);
> --
> 2.34.1
>