From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (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 9DBED383985 for ; Fri, 31 Jul 2026 07:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785482824; cv=none; b=PPtQSiIaictWeKhNIL8ZaKtzo4h+GsgBAUG2huSHJsU+pu1i6TUE722Sh0KlppHZ1leQJqJ40A5kznq+sq+xTGHdT9vvb32yt3pBW0mZFUyTI4nEc201Gzj1tKy++1IfaIRhEOGj9KPtDdEUA087V2FeVmhEvsgj3SHx7rDQ7MU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785482824; c=relaxed/simple; bh=Zk40oL+XyMMtcbCucc58bDurbeppUDrT2bJuTG3gcXw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pE3Z+j5jCU3Fgp+20p4WRZ5MbmDcxpcecNNOF42LnyEDRxGbOO1IBgAS1bkX0JzcJpKdTntQgqjqgejS66NUnLC5S/vJ95Fh9J0dXZ+CYp58LFBC1qQIY5F0Fvyq/QkDpGwWYWv2SPWRfnLkUim/kTEef29nyrW6vSeEdJDeG80= 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=JFAvX3fY; arc=none smtp.client-ip=115.124.30.132 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="JFAvX3fY" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1785482812; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=eLNMJHOFfOlCx+slGzSsXWk0YgYOSUN0fbbglHvBxqc=; b=JFAvX3fYVpJpQ92Y2J3n6EPJQYkK7TglSa9v15WlNI/wTpBCMTptoKteTIuL2NdCbkc5EKKcLo7rmcZK8p8qpQJbHuBWNrtFp+VZkFlB5jAhSvOq+JOEk6+jezPY39v3pM4tTR9izpWzxK7obggUHhhUiAsZOTcSiRRcxpSciU4= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045098064;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0X87FsqD_1785482810; Received: from 30.221.147.207(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X87FsqD_1785482810 cluster:ay36) by smtp.aliyun-inc.com; Fri, 31 Jul 2026 15:26:51 +0800 Message-ID: <3869ea1a-23e4-4b82-bebc-8cf1ae282fc5@linux.alibaba.com> Date: Fri, 31 Jul 2026 15:26:50 +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: [RFC PATCH v2 5/5] mm: mglru: run aging if the preferred type has no folios in reclaimable gens To: "Barry Song (Xiaomi)" , akpm@linux-foundation.org, linux-mm@kvack.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, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, linux-kernel@vger.kernel.org, lyugaofei@xiaomi.com, stevensd@chromium.org References: <20260726122123.7614-1-baohua@kernel.org> <20260726122123.7614-6-baohua@kernel.org> From: Baolin Wang In-Reply-To: <20260726122123.7614-6-baohua@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/26/26 8:21 PM, Barry Song (Xiaomi) wrote: > Respect the type selected by positive_ctrl_err(). If there are no > reclaimable gens left for that type, run aging. > > Signed-off-by: Barry Song (Xiaomi) > --- > mm/vmscan.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 7c13dedb0b1f..d63322cdb1bc 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -4996,6 +4996,10 @@ static bool should_run_aging(struct lruvec *lruvec, unsigned long max_seq, > if (evictable_min_seq(min_seq, swappiness) + MIN_NR_GENS > max_seq) > return true; > > + /* run aging if the preferred type is exhausted */ > + if (min_seq[type] + MIN_NR_GENS > max_seq) > + return true; > + > /* try to avoid aging, do gentle reclaim at the default priority */ > if (sc->priority == DEF_PRIORITY) > return false; Looks reasonable to me. Additionally, for sc->priority > DEF_PRIORITY, is there the same check logic for the scan type? if (min_seq[type] + MIN_NR_GENS == max_seq) return true;