From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 4B76B33F399 for ; Fri, 12 Jun 2026 15:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781277042; cv=none; b=Wsg4OFCEdFHXxXbe4hgG+Ekj3EDxW4lExawFk9bY95ckswK34FDC7TEZ7Wj7OKMnG7cqWv+QZBqqRA8EBZfw8eZso2QyAXqjzlOAjKFg+lNb9hoFGHsZ8Bql86Clz9uE+rJfQz0pipHOM7vwJzMX5WZro1GvM8WdhhO8kBgnqqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781277042; c=relaxed/simple; bh=yvRwnfke+gR8CvPxbW4hIvYo3rg5h4wzJkd0DCUM5/M=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FveHHG7sKO6caT2mw6QiHkfiDCRHMuAxJdOwwr6lxoMq7MWlnDIh5ch8h+hcKEJBpmrvwmrKmYVnAiEbkAM3MENpGVMW2AmiDW0n7tI0XXGMzHR5W7KXkVLqEjkSgsH3kXJIAhHKS5MWwC4zEI6KzQHuak8orLVfb24rbxMSNy4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=BPvek/Vs; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="BPvek/Vs" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-45ef5b33e73so113797f8f.1 for ; Fri, 12 Jun 2026 08:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1781277039; x=1781881839; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=r+wHGQUoTaWREIUgxGSBFddc2d96JHLcrCAUtlqMtQg=; b=BPvek/VsC6k1GR7PMreTHxDhwCBgFQhhOxtf+5qOWEQq871OemEkgM7HsjRW0W/Yyi OlRfI+z09PfpkXudYnDqPRkWlWJV1BoVqFCJWlP6xhlrST6td9e/3u1b6sbqhalS5cS/ dbMQbD7oDa1l7FGXtOsFHeXoPS3TmZ3ldJ6sQNwIZrdk6lskcv7KHX4a1yTMIpmJfKDV jvy4Fth9QbiMUZzpa5ojNRVEmDmAyIcu/RLZjrOkb1DqJNb0rwc9w/HegUnn7fDchCS2 73RQAv+Bxl76HWr2BTWxapjruf21vk4S05DspOF4Kvy4F1ghtQNkhhTfaJROSPz56AXi CJWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781277039; x=1781881839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=r+wHGQUoTaWREIUgxGSBFddc2d96JHLcrCAUtlqMtQg=; b=bT9PcQwM9V2yqZRxIsxVtd2J0mRENcBBFEP6wC/caFC2/6M58fqb8Uv6xt94bHoCes j6Ckcq1RtOVGjxd4AuQeZzi5/qbmfyuJYgNkM3F99y3+U4YjWMQTWe7E+8/+s56ddi6x 22RAfc6S3S9fTTviVuJX3FztsBOWrCJ4/RSHH1/9HmTy6LOQnSQ3I9ouZIetjz4gsOg/ cvoVF4X6briDcpWNM6LbXARMAJfHo2cyi4XB0/wDGD5mPjMnI7QKDFDwKNBsK8XgN5ZT 8Fm48lsWLSYLgXbetqnIQvbKmwUPQNc6Q4kcljoeqSNkokr2qiPVq2KKdFpIJp2FWdY4 juBg== X-Forwarded-Encrypted: i=1; AFNElJ+CJggL67uAoCgZPVEZdvH899zGkse68WtGNYEM0nveb6HwsljdOY0JmYN0esnkZ69Y3qO2t3OXeYZyLXg=@vger.kernel.org X-Gm-Message-State: AOJu0YytkaoUhpP0JN6g8oVGnv0ReMTFsrEIPLpnLyNlw4xedhFc6lrH WeHzDrs5Qwaj6OgRgETEBmhI6HhPTLs3ZveoaqnrdpXlxNOdRe8ESslpbskDSVMFPJg= X-Gm-Gg: Acq92OGUOR04SpJrqqB17UQFY+O9RcvcCXk040RAeaU3e+I2VJrURgiDEwpFTjFM6nN cqAUltduPqvl8diPu1bhwZKC0vjofCmcRp90d3W4DX8wCZeK2MrPWrwtKmLhNdAt/e+FIqD9UgX a4ixa0uGEIyjB8FGmRHHme9phjjE2tIRTrHfnDyUQ4lbBSDEmKnG9ylSGAlCREpTGT0lZIpp51Z LP0sbEUqNCkOhqQAOCrRG1EvLCjO3VgNGsC0PU6OAAWBnWoy+5WJUUT/06pdAeHufq2mQgS4lCy KvlMuZC0n/nta1I6XiEJAhjA7Rg9hXpeoZoiSGSy9yXqwpS0csXrcQAZ8YMoXJvl/a4FKn9NvBS x3fx+gT2jSk4+oC6ajvUMiR6UTMl7Er0VdDwwhe22dInElOBZzaoI+X0OAUZ50JHO0DY49DOIWJ /zeT0WM7Pjde/fZj4V9aR43cvbuFwEK0eysAgKCzGuTfI/HYPjxpxXyH+WBzV5OSHVV42a771Hh j6IJ/e5HiPHu/F2DF7myBhs0JM= X-Received: by 2002:a05:6000:188e:b0:450:4980:b4fe with SMTP id ffacd0b85a97d-4606da5d5bemr2432538f8f.2.1781277039385; Fri, 12 Jun 2026 08:10:39 -0700 (PDT) Received: from mordecai (dynamic-2a00-1028-83b8-1e7a-3010-3bd6-8521-caf1.ipv6.o2.cz. [2a00:1028:83b8:1e7a:3010:3bd6:8521:caf1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f26f23fsm6636334f8f.9.2026.06.12.08.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 08:10:38 -0700 (PDT) Date: Fri, 12 Jun 2026 17:10:36 +0200 From: Petr Tesarik To: "David Hildenbrand (Arm)" Cc: Andrew Morton , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, Brendan Jackman , Johannes Weiner , Zi Yan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] mm: reduce NODE_RECLAIM_xxx and change to enum Message-ID: <20260612171036.0bb6a2ed@mordecai> In-Reply-To: References: <20260612085052.59291-1-ptesarik@suse.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-suse-linux-gnu) 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-Transfer-Encoding: 7bit On Fri, 12 Jun 2026 16:57:08 +0200 "David Hildenbrand (Arm)" wrote: > On 6/12/26 10:50, Petr Tesarik wrote: > > Change node_reclaim() to return an enum indicating whether any > > pages have been reclaimed, because that's all the information > > needed by the only caller, get_page_from_freelist(). > > > > This leads to the following translation of the old macro > > identifiers to the new enum values: > > > > - NODE_RECLAIM_NOSCAN -> NODE_RECLAIM_NONE > > - NODE_RECLAIM_FULL -> NODE_RECLAIM_NONE > > - NODE_RECLAIM_SOME -> NODE_RECLAIM_SUCCESS > > - NODE_RECLAIM_SUCCESS -> NODE_RECLAIM_SUCCESS > > Why not simply return the number of reclaimed pages (0 vs > 0)? I agree that a > bool is not good. > > Or if that is not good enough (for some reason) return 0 (success) vs. -ENOENT? I don't have a strong opinion, except I hate the current code. ;-) If we can agree that get_page_from_freelist() need not recheck with zone_watermark_ok() after __node_reclaim() returns zero, then I believe the cleanest option is to return the number of pages (zero if reclaim was not even attempted). Petr T