[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f00bd734-df95-4057-8263-460c044298f8@lucifer.local>
Date: Fri, 1 Aug 2025 16:53:04 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>,
Ryan Roberts <ryan.roberts@....com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...hat.com>,
"H . Peter Anvin" <hpa@...or.com>, Vlastimil Babka <vbabka@...e.cz>,
Zi Yan <ziy@...dia.com>, Mike Rapoport <rppt@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Michal Hocko <mhocko@...e.com>, David Hildenbrand <david@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>, Nico Pache <npache@...hat.com>,
Dev Jain <dev.jain@....com>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org,
willy@...radead.org, linux-mm@...ck.org, x86@...nel.org,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
"Darrick J . Wong" <djwong@...nel.org>, mcgrof@...nel.org,
gost.dev@...sung.com, hch@....de, Pankaj Raghav <p.raghav@...sung.com>
Subject: Re: [RFC v2 1/4] mm: rename huge_zero_page_shrinker to
huge_zero_folio_shrinker
On Thu, Jul 24, 2025 at 04:49:58PM +0200, Pankaj Raghav (Samsung) wrote:
> From: Pankaj Raghav <p.raghav@...sung.com>
>
> As we already moved from exposing huge_zero_page to huge_zero_folio,
> change the name of the shrinker to reflect that.
>
> No functional changes.
>
> Suggested-by: David Hildenbrand <david@...hat.com>
> Acked-by: David Hildenbrand <david@...hat.com>
> Signed-off-by: Pankaj Raghav <p.raghav@...sung.com>
Makes sense to rename other related stuff as pointed out by Ritesh and
David, but for this part:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
> ---
> mm/huge_memory.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 2b4ea5a2ce7d..5d8365d1d3e9 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -266,15 +266,15 @@ void mm_put_huge_zero_folio(struct mm_struct *mm)
> put_huge_zero_page();
> }
>
> -static unsigned long shrink_huge_zero_page_count(struct shrinker *shrink,
> - struct shrink_control *sc)
> +static unsigned long shrink_huge_zero_folio_count(struct shrinker *shrink,
> + struct shrink_control *sc)
> {
> /* we can free zero page only if last reference remains */
> return atomic_read(&huge_zero_refcount) == 1 ? HPAGE_PMD_NR : 0;
> }
>
> -static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
> - struct shrink_control *sc)
> +static unsigned long shrink_huge_zero_folio_scan(struct shrinker *shrink,
> + struct shrink_control *sc)
> {
> if (atomic_cmpxchg(&huge_zero_refcount, 1, 0) == 1) {
> struct folio *zero_folio = xchg(&huge_zero_folio, NULL);
> @@ -287,7 +287,7 @@ static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
> return 0;
> }
>
> -static struct shrinker *huge_zero_page_shrinker;
> +static struct shrinker *huge_zero_folio_shrinker;
>
> #ifdef CONFIG_SYSFS
> static ssize_t enabled_show(struct kobject *kobj,
> @@ -849,8 +849,8 @@ static inline void hugepage_exit_sysfs(struct kobject *hugepage_kobj)
>
> static int __init thp_shrinker_init(void)
> {
> - huge_zero_page_shrinker = shrinker_alloc(0, "thp-zero");
> - if (!huge_zero_page_shrinker)
> + huge_zero_folio_shrinker = shrinker_alloc(0, "thp-zero");
> + if (!huge_zero_folio_shrinker)
> return -ENOMEM;
>
> deferred_split_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
> @@ -858,13 +858,13 @@ static int __init thp_shrinker_init(void)
> SHRINKER_NONSLAB,
> "thp-deferred_split");
> if (!deferred_split_shrinker) {
> - shrinker_free(huge_zero_page_shrinker);
> + shrinker_free(huge_zero_folio_shrinker);
> return -ENOMEM;
> }
>
> - huge_zero_page_shrinker->count_objects = shrink_huge_zero_page_count;
> - huge_zero_page_shrinker->scan_objects = shrink_huge_zero_page_scan;
> - shrinker_register(huge_zero_page_shrinker);
> + huge_zero_folio_shrinker->count_objects = shrink_huge_zero_folio_count;
> + huge_zero_folio_shrinker->scan_objects = shrink_huge_zero_folio_scan;
> + shrinker_register(huge_zero_folio_shrinker);
>
> deferred_split_shrinker->count_objects = deferred_split_count;
> deferred_split_shrinker->scan_objects = deferred_split_scan;
> @@ -875,7 +875,7 @@ static int __init thp_shrinker_init(void)
>
> static void __init thp_shrinker_exit(void)
> {
> - shrinker_free(huge_zero_page_shrinker);
> + shrinker_free(huge_zero_folio_shrinker);
> shrinker_free(deferred_split_shrinker);
> }
>
> --
> 2.49.0
>
Powered by blists - more mailing lists