From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E70E4380FF8 for ; Sun, 26 Jul 2026 12:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785068509; cv=none; b=Hxh20KM+G+A4X7tgDSO3TF/NyAKXm/r9aRqo4RoplM9pi3WDYJZ4mJjw9OKT2RV2ZHIR71eqSQwjQ8W0i1asX9GI1YbsQz44HPS5URKmG0N62G9TUhqS8DueV6VZheiD9JVAErYN37lZbwdXE9hXOLK4Gz/B0sz0Twpu8UDH7Bo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785068509; c=relaxed/simple; bh=nkv4Ln5F/jiFOhLYE5ev6b/x8amm7QKF+dUTS9FvWIM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gQVhVaDZuVCeFpg4tcu6SJSpWZ4FOzX6CML6LIzsQ1ufKCRy/PcGQII6mFkx4lch6yK/cTinQgU8a9x+tXqmciKqwAdRaXM5dVE2lzBJEIrUFpgvlChGeOZBkrBEGS8lK5FxbIh4Jj6rP/C6z1/VScTJZkLKR6Sj9vrYSH/RPGU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QuEtF8em; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QuEtF8em" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B52421F00A3E; Sun, 26 Jul 2026 12:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785068507; bh=i3Tpy/wzxEiLfJdRmM1ww5rxhETR55Vkf0Ib0Boy9nA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QuEtF8emADZd3nUVu6RKBf1T046tPnG23cP4gefkFbl3peonpAXCR0gZMAC/7u5Bw DG+yzaNjJCOv2OXBVcpU3x0dyfM3z/RGu14J102sRLXjx4ly5s59kRJz302VlBe6/P cYB/+djpMsx2pdjcrp/YdvHkGI4rosj+wejlNgLrwekIWgYB/X3kNleg93wbd3qhXT A2/bfKvHrwt5Uk2aYulnyWjxCl2S80ZlsDh3glPHrI+UMrA2NH1pzMfEC6rXIE39Pf 01DsPm4p16CH2Nsu62GcUAlUL+/m8gXtQ0HzoheddLXLahs63HpzWYaJzhPsJKNhDC 7Ui5Mn7ihYEsg== From: "Barry Song (Xiaomi)" To: 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, "Barry Song (Xiaomi)" Subject: [RFC PATCH v2 5/5] mm: mglru: run aging if the preferred type has no folios in reclaimable gens Date: Sun, 26 Jul 2026 20:21:23 +0800 Message-Id: <20260726122123.7614-6-baohua@kernel.org> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20260726122123.7614-1-baohua@kernel.org> References: <20260726122123.7614-1-baohua@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; -- 2.39.3 (Apple Git-146)