From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (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 6EC3538330B for ; Sat, 18 Jul 2026 09:54:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784368462; cv=none; b=Kn4HAIwuZZpF2SaSi16xs8XDD/xvCoOWrQSJGfka3I2abGtuvQo3ZVdlyRNTroyN9XQ50FwVxK/vajZj5WRSp+wNRAlkGOk97SSEmitVzOYHOO8BiWvgF+Tkzoxlizt8QE8tEQ8na7IASiy+40iajkRHwWOkucGsaJo0jLDfPtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784368462; c=relaxed/simple; bh=30wdl7j+cR4qYZaY7UEuOSr/RxCsU7QXnSe6OX6BezY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ShZJIHRLiRDecCY+HNkfglTteXZlaes+zh2p7WnJt5Tyq/hpi2iUo6WKzKS1BRTidxEnoX6sJXe2k44hZO0gecn3CGH8RnGXKLyLtLv74ZW3YC39ePmnAHDmMUNNUhIhRV4cSZUVHCT8lJHocCRCP+CJv99M3BHbVPCypn0t2jg= 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=dcdhmu96; arc=none smtp.client-ip=95.215.58.173 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="dcdhmu96" 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=1784368459; 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=x3ltDvom3/qAw8FbUiS3p4apXbK6gN1G2ur4K5UNTpA=; b=dcdhmu96Qo8lUZA4Nqrn4+MdC0HqrZoWIpF8V4mR4juUWJXtbnXjebaQ34mUNoFJcz2VsB m9wmvCYR4Hrkh5fWtlsNOt7eyV4CG1L2CJ7FVqEBY4bSEXRbLzpyChRw4V7Um1ZregR+JQ Y/fOp/x2m+X7tk6YsmTUXM2DP2drA0U= From: Ridong Chen To: akpm@linux-foundation.org Cc: hannes@cmpxchg.org, david@kernel.org, mhocko@kernel.org, qi.zheng@linux.dev, shakeel.butt@linux.dev, ljs@kernel.org, kasong@tencent.com, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, hezhongkun.hzk@bytedance.com, muchun.song@linux.dev, dave@stgolabs.net, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ridong.chen@linux.dev, Ridong Chen Subject: [PATCH v2 2/4] mm: vmscan: propagate real error code from per-node proactive reclaim Date: Sat, 18 Jul 2026 17:52:49 +0800 Message-ID: <20260718095251.82937-3-ridong.chen@linux.dev> In-Reply-To: <20260718095251.82937-1-ridong.chen@linux.dev> References: <20260718095251.82937-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 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 d6b383d96a0c..cfe4556c96d7 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -8017,7 +8017,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.43.0