From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 389CA23EAB4 for ; Mon, 13 Jul 2026 11:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783940690; cv=none; b=LBnkfFpRm9iggVGcXF0jOQn+3XXXO2K0xjoJS+FIgv/44Dnm5puH5yaHGBDAq793pLpzESj9YjWTaJR0C2PvCffqkIKP8JN3d/fGf/sbz8xqgPyXNKg2lG5Gr8os8scB1Cl2+iEEY19B3NwRkPb2EvSpUW50SJv8FU4i8GdB5D8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783940690; c=relaxed/simple; bh=qydouMB98/2O7jKKbYJM/dZTjl7lY6QFRViqT2aZ38M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mDAKfdizJrKxreByp6Sh4+mLudu8nB8lCJLFBYeymv+LVqhuxBdNBUVny8BhKdZ4hDw9FcXUFfV8MUL3osCvpfuaHWU+A7/q5wA6KXZMjUM6PF7bm8X6rPcpSbmt0OImpzLi0qXp/IKOaeS4TANPdANqwIOn6y8CN8sNWmCy0EQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=iT2VZStA; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="iT2VZStA" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-493bf73ec2aso20952795e9.2 for ; Mon, 13 Jul 2026 04:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1783940685; x=1784545485; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=cojcc5VUT628xzASOMK5s3Jnv6iTJKrLxDZeFtLk3P4=; b=iT2VZStAo5bsAkAMHzYatqhQHhlB+LBqT4H1tt5uLPpD9khUjyI0f6d30MyFDEFcRj XVlOS1O3q9bq56KIvRk0EQlkKxde7/7SojGj8M41T+Fh7+RU2Odw4JBAq5lxjcGpxkp4 RHZiXpvl2GZio/SGOT+cD+aZZSSDWkvLjT2WQXIc/PQsMceoYTndhXyId4JPA6euabjv C45ToZQks3fxnm0VP/X/n1SthZtdERrHlUdpnxKbdkLyJvOs41jYzRhNwtk8agJBlZMu SdrNRc1mcoooGewdCHExhaQLgAphZ933Nr11MfgaqUN7HdIi1/jogIPCINkE+CUOLD52 TgjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783940685; x=1784545485; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cojcc5VUT628xzASOMK5s3Jnv6iTJKrLxDZeFtLk3P4=; b=CznQ0KVuTbwAoUh6fZSdG/SrlOz6EKQiFpdHhRrYL1q+O0dZzEJaBAGMMnb8f9/1v6 0LPioaWCyVetjEQkEe2mayz33l90+E33Q38txgbQlXyAx1fN6kLlSPICysAxevZ4nBbJ PIsvWpWxDfSEmcBmf/aNTSWMnLC/k37aOALuYxoGyEeZFliy/gyei75L6dpx1FoqLLkg dlkqlO4YjWx1i1D4kJmwxc14mLPMNvIbWaL8Zlqcd8zuEVfLi+6leDDGjQAzaT0yMyaz fjA/6pNOwvto+XnqlxSWNLgtwepGmdY0IQ7mDSujkRO7iHSQC4cqdaxUfQbsYaEV2cfs xpcA== X-Forwarded-Encrypted: i=1; AHgh+RqSIyAPmMlWaxAPu5WyRfrEKdosPzVsaw5b35lNjQQwxO+hF/yc3WA2UteGTCjFoKfjadpYL3vIxdPSlMs=@vger.kernel.org X-Gm-Message-State: AOJu0Yyts7GUpIuBR4cBd+cGeSLaScdXWmZjMwJA50b4lUomWi02fxZm 6adKiso+9z80qon6NVpEldmy6wgEUYTTLnSlg50rSVs3aLpV6x3WgkM1tPbGmzEmeHo= X-Gm-Gg: AfdE7ckRKIvITwxs1p6joXwMv4ZFXh4QMdwZDPzfvss0Faq2pSZ/euXGuwsRT31C29X qj09PG08MfLbaId1o0O7zil52D5bnCNs42/f4x36ve/+htJ+wt/51Dnc6pZqjnM8KDkaO0+d80p r7gc2l3VMKJWq+PSfJ1WtygnyVWF2b8+fOVNPhGyG55t1nU1kE2cbvI5O6vEgr7KzcQBPazcakK WD0OzrYvrZsgPuqCtJNe9Fbltk1bt0cP3m56Tl0w8WG7K5gh0N+DNtsOZY0t/4jEJlNyV1UXOat uLrCwp93AMeKNwep/tT7ZsNiYtdVq/0jsKlK7RuGbcFSel5Cbfpt3NDRi4HkLSLWHJehktD09By LC6O6oN+R6p/6W2mAhevho6JVKqdXNl9p4q4tbSfIKpb2IITNFmt9uuJ3St/WKhYNeuW2fNQ9Vo UKwgwMVUA3lw== X-Received: by 2002:a05:600c:8285:b0:492:41c9:886b with SMTP id 5b1f17b1804b1-493f87e5a53mr89975585e9.14.1783940685235; Mon, 13 Jul 2026 04:04:45 -0700 (PDT) Received: from localhost ([2a02:8071:6401:180:d892:bf43:a0b4:83b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493eb6d4f9fsm364070595e9.4.2026.07.13.04.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 04:04:44 -0700 (PDT) Date: Mon, 13 Jul 2026 07:04:43 -0400 From: Johannes Weiner To: Petr Tesarik Cc: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, Brendan Jackman , Zi Yan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/1] mm: let node_reclaim() return the number of pages reclaimed Message-ID: <20260713110443.GD276793@cmpxchg.org> References: <20260710152320.2024283-1-ptesarik@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260710152320.2024283-1-ptesarik@suse.com> On Fri, Jul 10, 2026 at 05:23:20PM +0200, Petr Tesarik wrote: > There is only one caller, get_page_from_freelist(), and it does not make > any use of the reason for skipping the reclaim, nor does it make any > distinction between a full and partially successful reclaim. > > Therefore, node_reclaim() can simply return the number of pages that have > been reclaimed, same as __node_reclaim(), and the NODE_RECLAIM_xxx macros > can be removed. > > There is one small change of behavior when __node_reclaim() was attempted > but returned zero. The allocation now skips the zone immediately; before > this patch, the zone watermarks were checked first. I believe it was an > oversight rather than intention, because the chances that zone watermark is > OK after __node_reclaim() did not reclaim any pages are very close to zero. > > Originally, I was looking for occurences of NODE_RECLAIM_SOME and > NODE_RECLAIM_SUCCESS, but I couldn't find any. That's because they are > typecast from the result of a relational operator. This seemed a bit > fragile, so I dug a bit deeper and came up with this proposed cleanup. > > Signed-off-by: Petr Tesarik Looks good to me, and agree with the minor change in behavior being acceptable. With the macros actually removed, Acked-by: Johannes Weiner