From: Hannes Reinecke <hare@suse.de>
To: David Hildenbrand <david@redhat.com>,
Kiryl Shutsemau <kirill@shutemov.name>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Pankaj Raghav (Samsung)" <kernel@pankajraghav.com>,
Suren Baghdasaryan <surenb@google.com>,
Ryan Roberts <ryan.roberts@arm.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Vlastimil Babka <vbabka@suse.cz>, Zi Yan <ziy@nvidia.com>,
Mike Rapoport <rppt@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Michal Hocko <mhocko@suse.com>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Nico Pache <npache@redhat.com>, Dev Jain <dev.jain@arm.com>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Jens Axboe <axboe@kernel.dk>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
willy@infradead.org, Ritesh Harjani <ritesh.list@gmail.com>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
"Darrick J . Wong" <djwong@kernel.org>,
mcgrof@kernel.org, gost.dev@samsung.com, hch@lst.de,
Pankaj Raghav <p.raghav@samsung.com>
Subject: Re: [PATCH v3 0/5] add persistent huge zero folio support
Date: Mon, 18 Aug 2025 08:57:46 +0200 [thread overview]
Message-ID: <728b9bd5-f423-48cf-a9e0-31270d0b9506@suse.de> (raw)
In-Reply-To: <6afa5cab-2044-46fb-9afb-8be82fe8a39f@redhat.com>
On 8/11/25 12:43, David Hildenbrand wrote:
> On 11.08.25 12:36, Kiryl Shutsemau wrote:
>> On Mon, Aug 11, 2025 at 12:21:23PM +0200, David Hildenbrand wrote:
>>> On 11.08.25 12:17, Kiryl Shutsemau wrote:
>>>> On Mon, Aug 11, 2025 at 11:09:24AM +0100, Lorenzo Stoakes wrote:
>>>>> On Mon, Aug 11, 2025 at 11:07:48AM +0100, Kiryl Shutsemau wrote:
>>>>>>
>>>>>> Well, my worry is that 2M can be a high tax for smaller machines.
>>>>>> Compile-time might be cleaner, but it has downsides.
>>>>>>
>>>>>> It is also not clear if these users actually need physical HZP or
>>>>>> virtual
>>>>>> is enough. Virtual is cheap.
>>>>>
>>>>> The kernel config flag (default =N) literally says don't use unless
>>>>> you
>>>>> have plenty of memory :)
>>>>>
>>>>> So this isn't an issue.
>>>>
>>>> Distros use one-config-fits-all approach. Default N doesn't help
>>>> anything.
>>>
>>> You'd probably want a way to say "use the persistent huge zero folio
>>> if you
>>> machine has more than X Gigs". That's all reasonable stuff that can
>>> be had
>>> on top of this series.
>>
>> We have 'totalram_pages() < (512 << (20 - PAGE_SHIFT))' check in
>> hugepage_init(). It can [be abstracted out and] re-used.
>
> I'll note that e.g., RHEL 10 already has a minimum RAM requirement of 2
> GiB. I think for Fedora it's 1 GiB, with the recommendation of having at
> least 2 GiB.
>
> What might be reasonable is having a kconfig option where one (distro)
> can define the minimum RAM size for the persistent huge zero folio, and
> then checking against totalram_pages() during boot.
>
> But again, I think this is something that goes on top of this series.
> (it might also be interesting to allow for disabling the persistent huge
> zero folio through a cmdline option)
>
Please make this a kernel config option and don't rely on heuristics.
They have the nasty habit of doing exactly the wrong thing at places
where you really don't expect them to.
(Consider SoCs with a large CMA area for video grabbing or similar stuff
and very little main memory ...)
A kernel option will give distros and/or admins the flexibility they
need without having to rebuild the kernel and also not having to
worry about heuristics going wrong.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2025-08-18 6:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 8:41 Pankaj Raghav (Samsung)
2025-08-11 8:41 ` [PATCH v3 1/5] mm: rename huge_zero_page to huge_zero_folio Pankaj Raghav (Samsung)
2025-08-11 8:41 ` [PATCH v3 2/5] mm: rename MMF_HUGE_ZERO_PAGE to MMF_HUGE_ZERO_FOLIO Pankaj Raghav (Samsung)
2025-08-11 8:41 ` [PATCH v3 3/5] mm: add persistent huge zero folio Pankaj Raghav (Samsung)
2025-08-11 8:41 ` [PATCH v3 4/5] mm: add largest_zero_folio() routine Pankaj Raghav (Samsung)
2025-08-11 8:41 ` [PATCH v3 5/5] block: use largest_zero_folio in __blkdev_issue_zero_pages() Pankaj Raghav (Samsung)
2025-08-11 9:35 ` Pankaj Raghav
2025-08-11 9:44 ` David Hildenbrand
2025-08-11 9:43 ` [PATCH v3 0/5] add persistent huge zero folio support Kiryl Shutsemau
2025-08-11 9:49 ` David Hildenbrand
2025-08-11 9:52 ` David Hildenbrand
2025-08-11 10:07 ` Kiryl Shutsemau
2025-08-11 10:09 ` Lorenzo Stoakes
2025-08-11 10:17 ` Kiryl Shutsemau
2025-08-11 10:21 ` David Hildenbrand
2025-08-11 10:36 ` Kiryl Shutsemau
2025-08-11 10:38 ` Lorenzo Stoakes
2025-08-11 10:43 ` David Hildenbrand
2025-08-18 6:57 ` Hannes Reinecke [this message]
2025-08-11 10:19 ` Pankaj Raghav (Samsung)
2025-08-11 10:12 ` Pankaj Raghav (Samsung)
2025-08-12 3:52 ` Ritesh Harjani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=728b9bd5-f423-48cf-a9e0-31270d0b9506@suse.de \
--to=hare@suse.de \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=baolin.wang@linux.alibaba.com \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=djwong@kernel.org \
--cc=gost.dev@samsung.com \
--cc=hch@lst.de \
--cc=kernel@pankajraghav.com \
--cc=kirill@shutemov.name \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mcgrof@kernel.org \
--cc=mhocko@suse.com \
--cc=npache@redhat.com \
--cc=p.raghav@samsung.com \
--cc=ritesh.list@gmail.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=surenb@google.com \
--cc=tglx@linutronix.de \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox