From nobody Sun Oct 5 14:34:02 2025 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (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 EAF7514EC62; Mon, 4 Aug 2025 12:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754309666; cv=none; b=Dkfn2FAmY+p13J6CC95/2WXnnwT+dgM1YR/mhKa5Y1tM+/NVtlGABtryjcsGMzHLrERx4oOrqWEEDjayJFT4H4eFSoKagI4vZCCqQCvJcyKpVG88ialgxZA+2lKagqTMuTSsp7gdX8Xc6BRUF5js1xdEYtjvG+6mUFvuqI5Pq6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754309666; c=relaxed/simple; bh=d5cqKEY5CbIXWeLXswhu4+/IzdeUgge67U0jVF/tfAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r9gvGWsqa6r/Z248cldDNkLNqIesj+dq6DPNq7HZu4u0i0VZbqN2FVjPHH49zCB1b5sJtpQVq/K98O0ozdE+GauEvDuqQHZhNle0pAkIIhafXHxMruJdR6U2vmAymKz8v5yN98w8FtQKII7dMvCfG8FXWIPlU1mZRAIt0SgtxNI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=UqL2d18w; arc=none smtp.client-ip=80.241.56.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="UqL2d18w" Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4bwb871KgPz9st4; Mon, 4 Aug 2025 14:14:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1754309655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wg6vfvVQRpqn/feIP7hePbKRJwLF2oar9zj0xHqTXhU=; b=UqL2d18wzvHrh7tJVeJYCXjGyxAtaFcs6MKVFbkeIkqEflCP4Dx6giEliPtbcnbWHyZDu7 P51MPKLvSqf93s2tp3y0kyjk/cFhINFXyu/CixWPgy8iugkpGbQT0MzLmFQ7SdKMIM9iW/ VdsYUqnPg/wxAYnDxCZlRu3iBvWowKQCoZgoUBDPxUwVHsT7x3EVmgjuhFl7Liv2ggwTUm I9TzT4YlcLDNf0AKGYKYedOlMnS6sLOEbkRgwuGIIKUOmUNu5W7jvCSvmxd4Cw8x6NtjBJ tCYS6XbMdIrkmm4Kn2SgHagJ+ipJV0xdoB6ACPdJnwr43ZnClFuU72io38LD1A== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of kernel@pankajraghav.com designates 2001:67c:2050:b231:465::2 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com From: "Pankaj Raghav (Samsung)" To: Suren Baghdasaryan , Ryan Roberts , Baolin Wang , Borislav Petkov , Ingo Molnar , "H . Peter Anvin" , Vlastimil Babka , Zi Yan , Mike Rapoport , Dave Hansen , Michal Hocko , David Hildenbrand , Lorenzo Stoakes , Andrew Morton , Thomas Gleixner , Nico Pache , Dev Jain , "Liam R . Howlett" , Jens Axboe Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, x86@kernel.org, linux-block@vger.kernel.org, Ritesh Harjani , linux-fsdevel@vger.kernel.org, "Darrick J . Wong" , mcgrof@kernel.org, gost.dev@samsung.com, kernel@pankajraghav.com, hch@lst.de, Pankaj Raghav Subject: [PATCH 1/5] mm: rename huge_zero_page to huge_zero_folio Date: Mon, 4 Aug 2025 14:13:52 +0200 Message-ID: <20250804121356.572917-2-kernel@pankajraghav.com> In-Reply-To: <20250804121356.572917-1-kernel@pankajraghav.com> References: <20250804121356.572917-1-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bwb871KgPz9st4 Content-Type: text/plain; charset="utf-8" From: Pankaj Raghav As we already moved from exposing huge_zero_page to huge_zero_folio, change the name of the shrinker and the other helper function to reflect that. No functional changes. Reviewed-by: Lorenzo Stoakes Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Signed-off-by: Pankaj Raghav --- mm/huge_memory.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2b4ea5a2ce7d..6625514f622b 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -207,7 +207,7 @@ unsigned long __thp_vma_allowable_orders(struct vm_area= _struct *vma, return orders; } =20 -static bool get_huge_zero_page(void) +static bool get_huge_zero_folio(void) { struct folio *zero_folio; retry: @@ -237,7 +237,7 @@ static bool get_huge_zero_page(void) return true; } =20 -static void put_huge_zero_page(void) +static void put_huge_zero_folio(void) { /* * Counter should never go to zero here. Only shrinker can put @@ -251,11 +251,11 @@ struct folio *mm_get_huge_zero_folio(struct mm_struct= *mm) if (test_bit(MMF_HUGE_ZERO_PAGE, &mm->flags)) return READ_ONCE(huge_zero_folio); =20 - if (!get_huge_zero_page()) + if (!get_huge_zero_folio()) return NULL; =20 if (test_and_set_bit(MMF_HUGE_ZERO_PAGE, &mm->flags)) - put_huge_zero_page(); + put_huge_zero_folio(); =20 return READ_ONCE(huge_zero_folio); } @@ -263,18 +263,18 @@ struct folio *mm_get_huge_zero_folio(struct mm_struct= *mm) void mm_put_huge_zero_folio(struct mm_struct *mm) { if (test_bit(MMF_HUGE_ZERO_PAGE, &mm->flags)) - put_huge_zero_page(); + put_huge_zero_folio(); } =20 -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) =3D=3D 1 ? HPAGE_PMD_NR : 0; } =20 -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) =3D=3D 1) { struct folio *zero_folio =3D xchg(&huge_zero_folio, NULL); @@ -287,7 +287,7 @@ static unsigned long shrink_huge_zero_page_scan(struct = shrinker *shrink, return 0; } =20 -static struct shrinker *huge_zero_page_shrinker; +static struct shrinker *huge_zero_folio_shrinker; =20 #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) =20 static int __init thp_shrinker_init(void) { - huge_zero_page_shrinker =3D shrinker_alloc(0, "thp-zero"); - if (!huge_zero_page_shrinker) + huge_zero_folio_shrinker =3D shrinker_alloc(0, "thp-zero"); + if (!huge_zero_folio_shrinker) return -ENOMEM; =20 deferred_split_shrinker =3D 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; } =20 - huge_zero_page_shrinker->count_objects =3D shrink_huge_zero_page_count; - huge_zero_page_shrinker->scan_objects =3D shrink_huge_zero_page_scan; - shrinker_register(huge_zero_page_shrinker); + huge_zero_folio_shrinker->count_objects =3D shrink_huge_zero_folio_count; + huge_zero_folio_shrinker->scan_objects =3D shrink_huge_zero_folio_scan; + shrinker_register(huge_zero_folio_shrinker); =20 deferred_split_shrinker->count_objects =3D deferred_split_count; deferred_split_shrinker->scan_objects =3D deferred_split_scan; @@ -875,7 +875,7 @@ static int __init thp_shrinker_init(void) =20 static void __init thp_shrinker_exit(void) { - shrinker_free(huge_zero_page_shrinker); + shrinker_free(huge_zero_folio_shrinker); shrinker_free(deferred_split_shrinker); } =20 --=20 2.49.0