From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (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 223CB318BB5 for ; Thu, 20 Aug 2026 09:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216579; cv=none; b=jimiIM3+buaTMflme2C7J1SwXIR2zG3+ZagxsDGI0cYXV1ULHLhwHAOc06L0jqrg2RjzIBaCnUAtziXNFdVdWOo2fILCpsC4nhJBWvO+kFrDpAoUV4RPwkYMdlZWAn8OM9OUsFAZY49pXdGLrq539YDM0IF45xVipsX0rnSJg7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787216579; c=relaxed/simple; bh=i3W1lSh8yDtddtqVxPKaPxLUEYwVMcKjpBfSTZYhgc8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EFUqXNRJPOB/2AwS/DIGGt0yPDkC4AS0c5xdIJXp3Ss2ARB3e5wFbqCEbxOfqDCK1n6yh1zi0yUtfnq7tgj/ics7agWBvVDp1fZ+ROKlawUFR//EsjVXYaiKYXjU5A+mx1BqYwCYubm/fyj+DQcYmJvSHI8oYq3W0BcLyXtrc/w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=lleejPVF; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="lleejPVF" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1787216572; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=WhwSASY61Vb36hFr4yqvOQldrzA+ZS8XNx2b1KiT3k0=; b=lleejPVFb1FghTXI09C5MD2znhPRbEQUL2eWvb1ALujWMPp1hoFWKRFCJNZ6USFkQQBJe1NlD0RqBZjnuf0NNDaFkOWiiJWUbWQspMCN7Emd1Cklf7tUnjlrctryMTm6Jfkb0PNQ5zEquQGeDTMjyWgWwa3kvi8wP8Lr9PnomXQ= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=20;SR=0;TI=SMTPD_---0X9IyxVj_1787216569; Received: from 30.74.144.123(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X9IyxVj_1787216569 cluster:ay36) by smtp.aliyun-inc.com; Thu, 20 Aug 2026 17:02:50 +0800 Message-ID: Date: Thu, 20 Aug 2026 17:02:49 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] mm/mglru: improve readability of isolate_folios() To: "Barry Song (Xiaomi)" , akpm@linux-foundation.org, linux-mm@kvack.org Cc: axelrasmussen@google.com, baoquan.he@linux.dev, chenridong@xiaomi.com, david@kernel.org, hannes@cmpxchg.org, kasong@tencent.com, lianux.mm@gmail.com, linux-kernel@vger.kernel.org, ljs@kernel.org, lyugaofei@xiaomi.com, mhocko@kernel.org, qi.zheng@linux.dev, shakeel.butt@linux.dev, stevensd@chromium.org, wangzicheng@honor.com, weixugc@google.com, yuanchu@google.com References: <20260820045603.68809-1-baohua@kernel.org> <20260820045603.68809-2-baohua@kernel.org> From: Baolin Wang In-Reply-To: <20260820045603.68809-2-baohua@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/20/26 12:56 PM, Barry Song (Xiaomi) wrote: > From: Ridong Chen > > The for_each_evictable_type() loop in isolate_folios() > is misleading: it does not actually iterate over each > evictable type. Instead, get_type_to_scan() selects the > type to scan, while the iterator `i` merely bounds the > number of attempts. > > Make the fallback behavior explicit in the code and remove the > opaque for_each_evictable_type(i, swappiness). > > Signed-off-by: Ridong Chen > Co-developed-by: Barry Song (Xiaomi) > Signed-off-by: Barry Song (Xiaomi) > --- LGTM. Reviewed-by: Baolin Wang > mm/vmscan.c | 46 ++++++++++++++++++++++++++-------------------- > 1 file changed, 26 insertions(+), 20 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index c1404a59523d..d5cc30b667ad 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -4833,35 +4833,41 @@ static int get_type_to_scan(struct lruvec *lruvec, int swappiness) > return positive_ctrl_err(&sp, &pv); > } > > +static inline bool is_single_type_reclaim(int swappiness) > +{ > + return swappiness == MIN_SWAPPINESS || > + swappiness == SWAPPINESS_ANON_ONLY; > +} I can't think of a better function name either, so I'm fine with it :)