From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D2C639C637 for ; Thu, 23 Jul 2026 04:58:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784782689; cv=none; b=X4hC92kyMjNTbYxnoNyVaebcgm3L9w4jfKWWmRnlLjJarGso4r/452Zc/ApDGWEuLT/ZLlAnh4dAz7LIQP/bjBVg1brXSrZ3X4q6vdjOB5hzNgAA6sLZXpR6IQLbAn9htpolQJIt5a3B0moxXMhVuTaQ8ek8VN7gzdzrKtrO2u8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784782689; c=relaxed/simple; bh=jfgLBeJ5mPfMtL7e/zlITyczBImKqjao9yUWNpolcnU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pq7BM1MbNh1GRiLEzT8ctKkUQ72MS81kNDypPa4odRj19eYx8HMSxeBncBYaSNYYhXr8OGBIvsoew7MRZ3VkGIaU/M4ifsGZQ17YkGBQRUK1LzPrxdeB/krtfygPqj3FI4sI9FawSGfNbiB5It3pJkGzGVV5wamrJBrIjPh9ke4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=qZ8jpXD9; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="qZ8jpXD9" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784782674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WLiqeUO9mMdZaSq28GFh6cxKKnMxg3tJr/8P87fRsfA=; b=qZ8jpXD9Z/jiKzsINhUHsr9GRrPLHvZDhSSdFCyPpq39qCSswGPIY/vbjTFRxB63umQj0X eP/zls4gT9lgtuJb9rkufCjPnF5bbDeJMpJfqLzf8zWvV1IYen2aDuRCBzjrE1AycRy/Kx TS+ADgWXFrKBTwRmrrIMr9+IxT+Lwek= From: Ridong To: Andrew Morton , Johannes Weiner Cc: David Hildenbrand , Michal Hocko , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Kairui Song , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Zhongkun He , Muchun Song , Davidlohr Bueso , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ridong Chen , Ridong Chen Subject: [PATCH v3 2/4] mm: vmscan: propagate real error code from per-node proactive reclaim Date: Thu, 23 Jul 2026 12:57:16 +0800 Message-Id: <20260723045718.2052070-3-ridong.chen@linux.dev> In-Reply-To: <20260723045718.2052070-1-ridong.chen@linux.dev> References: <20260723045718.2052070-1-ridong.chen@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Ridong Chen 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") Reviewed-by: Muchun Song Acked-by: Johannes Weiner Acked-by: Shakeel Butt Reviewed-by: Qi Zheng Reviewed-by: Barry Song Signed-off-by: Ridong Chen --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 2c689682b952..4b62d6304c49 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -8023,7 +8023,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); -- 2.34.1