From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 7FDD73F4DC5 for ; Fri, 17 Jul 2026 11:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784288044; cv=none; b=oDVywvRX76n27IY/MDw3gyBMKZCCsz4VI9vNgaBXHxnTf1a2isK/Qgf8/vzxP3Wq27ifx3aRFoqkiEcKLD0mf35NZXQVG3804XzoTVF2wtLICvbGlbvS3J1iZWx8ctK2urEC8zXM/LOyHrQajVffnCay0TPssYorhRvyqQDeMng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784288044; c=relaxed/simple; bh=6XbiC6AbwVTN8q21pbLa6f6Ks5nXpMEjJJ0qPoVzs1o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ff53qMqMC3udug2gwWjabOpig/sPg6fYm1hedFjhgXg8RoPYqdGVvLE4tFPbr3ENhThFzjNYeKfg9IC1LJ+EESSPEy0uDAsOMHVkk5eNXh1cYUIA/i/mbaIOAloYJBj0GyxXtIR5aOXh48B32nzqNrkppCZUJpbRyrv9o263G4w= 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=AZ+Yr0Xv; arc=none smtp.client-ip=95.215.58.180 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="AZ+Yr0Xv" 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=1784288038; 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=Sc0VGRUzcqdv3KA7EiSHGFvMq8ccWrkhZ0yDnBW1FTs=; b=AZ+Yr0XvBQ4M5QU7eoDtvL5dH5Q8zO9GotliAwIYiggIQqu7EA//ED38790jEB1jVDW3XI tdN+nU+xZx85OZGsrBfpuMdjWHYp41hkfasWqbU+3EKYwn3AS4Yr+3E1hKsLpPlq9EYylB 6Hvv+VDn3OXrBBlYwTjcoUi4iztPxnU= From: Ridong To: Andrew Morton , Johannes Weiner Cc: Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , David Hildenbrand , Michal Hocko , Lorenzo Stoakes , Zhongkun He , Muchun Song , Davidlohr Bueso , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ridong Chen , Ridong Chen Subject: [PATCH 2/3] mm: vmscan: propagate real error code from per-node proactive reclaim Date: Fri, 17 Jul 2026 19:32:59 +0800 Message-Id: <20260717113300.214717-3-ridong.chen@linux.dev> In-Reply-To: <20260717113300.214717-1-ridong.chen@linux.dev> References: <20260717113300.214717-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") 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 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; } static DEVICE_ATTR_WO(reclaim); -- 2.34.1