From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796321952; b=vRKjZ4HMkkwurGHK5vtMOJCetRIIyqXMfzb0m+FwBOhftNwo+60L4W+kXJC3qgkm2JRf TG/VMViZ0GUnVHYhwhKazcDyAdV/I5XV391h6hTdpLUKs6OyAlruSJpIc9m2of0nGtBZv IHH6Hzdi8D6Fe1YC1tQd6l04Z9S2Bb7H7bX6Er/eVjQPy3lX6OJpk7xduVELm54UNQbNV a+k0nIKglejB/idkNJ3twWuxHioLR3jXwxRmHD6DB3aTOzQd5eD3b7o+u/cfrnctg1DD2 gKix1X6LqohGECLZLTGyk48MPwxJPVfuv3aBJXB4C7gsBDXCfYtW9EtXjx8ZrlpoCVw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796321952; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=kS/YYJnOKtUatLTUuUkGps4NwCol2Up9tEoFPva+sKw=; b=HULUmguSr1lqOpvG3fsrA/TvOYOrZj7Wf/y9fyV2lJZRqIzw3b/8HHnDmiq3o9AIM1sU q2MLzwsfa5b0otDRmiMRolNhaLWfZ9TENjj/AJ7m+T9XMQ5SVN8XW2cF/sT5nDTWqPpqW ZYyp24qd4EPh9MZpB3d720DKBScyjInKywDUJSeKUhAKecriBeRnLv+5y2C1NgZMwn6IF g0t1uI5ymd/YRKfslpjCH5hgYhf8bHMuFcsBXf7lVDrOeKsWSey9D01i1irlEbadTzLWu a+QFcn8repayVQFv0a/mdU1mR2m+j+7/g9fb+sPBi0jYJemkcOK7hTIqYS3c5xO96Yg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=jctiNciF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F828606A32D for ; Thu, 3 Dec 2026 18:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=jctiNciF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48F671F00893; Thu, 3 Dec 2026 18:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796321952; bh=kS/YYJnOKtUatLTUuUkGps4NwCol2Up9tEoFPva+sKw=; h=Date:To:From:In-Reply-To:References:Subject; b=jctiNciFOIe7tpzctXHEAjSA1wA3IvQJjd+1grv1ru9K9mPDgGGPqXXHTY1LhcBHS ED8AokBFJmCEv002UhchdH2rNh3DpHaGPOt/i1/gmw722vQcSljNFtzjhn9e5m4Whv X1/ESmLtj5SH27jnqD7ATYo9VoIF6ErnPaggoeGI= Date: Thu, 03 Dec 2026 10:19:11 -0800 To: mm-commits@vger.kernel.org,chenridong@xiaomi.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261204-mglru-fg-v8-4-64f81c876c15@tencent.com> References: <20261204-mglru-fg-v8-4-64f81c876c15@tencent.com> Subject: + mm-mglru-rename-the-generation-offset-in-lru_gen_folio_seq.patch added to mm-unstable branch Message-Id: <20261203181912.48F671F00893@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: mm/mglru: rename the generation offset in lru_gen_folio_seq() has been added to the -mm mm-unstable branch. Its filename is mm-mglru-rename-the-generation-offset-in-lru_gen_folio_seq.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mglru-rename-the-generation-offset-in-lru_gen_folio_seq.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Ridong Chen Subject: mm/mglru: rename the generation offset in lru_gen_folio_seq() Date: Fri, 04 Dec 2026 01:02:35 +0800 lru_gen_folio_seq() computes how many generations below max_seq a folio should be added to, but stores it in a variable named "gen". Elsewhere in MGLRU "gen" means an index into lrugen->folios[], i.e. seq % MAX_NR_GENS, so reusing the name for a relative offset is confusing. Rename it to "age", which matches what the value means: the newest generation is age 1, and a larger age is an older generation. No functional change. [kasong@tencent.com: dropped the comment table part, the series rewrites it] Link: https://patch.msgid.link/20261204-mglru-fg-v8-4-64f81c876c15@tencent.com Signed-off-by: Ridong Chen Signed-off-by: Kairui Song Signed-off-by: Andrew Morton Reviewed-by: Barry Song Reviewed-by: Lian Wang Reviewed-by: Kunwu Chan Tested-by: Andrew Morton Reviewed-by: SJ Park Tested-by: Wang Lian (ByteDance) Tested-by: Tianyi Chen Cc: Johannes Weiner Cc: Muchun Song Cc: Qi Zheng Cc: Ying Huang Cc: Christopher Li Cc: Baoquan He Cc: Nico Pache Cc: Usama Arif Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: David Hildenbrand Cc: Lorenzo Stoakes Cc: Liam R. Howlett Cc: Axel Rasmussen Cc: Yuanchu Xie Cc: Wei Xu Cc: Vlastimil Babka Cc: Suren Baghdasaryan Cc: Nhat Pham Cc: Youngjun Park Cc: Zi Yan Cc: Gregory Price Cc: Matthew Wilcox (Oracle) Cc: Baolin Wang Cc: Ryan Roberts Cc: Dev Jain Cc: Lance Yang Cc: Hugh Dickins Cc: David Rientjes Cc: Yu Zhao Cc: Vernon Yang Cc: wangzicheng Cc: Tal Zussman Cc: Kairui Song Cc: Xiang Liu Cc: Ehab Ababneh Cc: zhaozhengzhuo Cc: Joanne Koong Cc: Hui Zhu Cc: Maxim Muzafarov Cc: Aveline Noir include/linux/mm_inline.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/include/linux/mm_inline.h~mm-mglru-rename-the-generation-offset-in-lru_gen_folio_seq +++ a/include/linux/mm_inline.h @@ -322,7 +322,7 @@ static inline void lru_gen_update_size(s static inline unsigned long lru_gen_folio_seq(const struct lruvec *lruvec, const struct folio *folio) { - int gen; + int age; int type = folio_is_file_lru(folio); const struct lru_gen_folio *lrugen = &lruvec->lrugen; @@ -339,15 +339,15 @@ static inline unsigned long lru_gen_foli * |<---------------------------- MAX_NR_GENS ---------------------------->| */ if (folio_test_active(folio)) - gen = MIN_NR_GENS - folio_test_workingset(folio); + age = MIN_NR_GENS - folio_test_workingset(folio); else if ((!folio_is_file_lru(folio) && !folio_test_swapcache(folio)) || (folio_test_reclaim(folio) && (folio_test_dirty(folio) || folio_test_writeback(folio)))) - gen = MIN_NR_GENS; + age = MIN_NR_GENS; else - gen = MAX_NR_GENS - (folio_test_workingset(folio) || folio_test_referenced(folio)); + age = MAX_NR_GENS - (folio_test_workingset(folio) || folio_test_referenced(folio)); - return max(READ_ONCE(lrugen->max_seq) - gen + 1, READ_ONCE(lrugen->min_seq[type])); + return max(READ_ONCE(lrugen->max_seq) - age + 1, READ_ONCE(lrugen->min_seq[type])); } /* _ Patches currently in -mm which might be from chenridong@xiaomi.com are mm-memcontrol-drop-unused-vmscan-tracepoint-include.patch mm-vmscan-move-vmscan-tracepoints-to-a-local-header.patch mm-vmscan-move-struct-scan_control-to-a-dedicated-header.patch mm-vmscan-pass-scan_control-to-the-vmscan-tracepoints.patch mm-mglru-add-tracepoint-for-scan_folios.patch mm-mglru-add-lruvec_gen_size-helper.patch mm-mglru-add-tracepoint-for-aging.patch mm-mglru-pass-a-seq-range-to-lru_gen_add_folio.patch mm-mglru-deactivate-anon-folios-into-the-oldest-generation.patch mm-mglru-rename-the-generation-offset-in-lru_gen_folio_seq.patch mm-mglru-skip-the-flags-cmpxchg-when-nothing-changes.patch