[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5dffdbca-c576-489c-b84a-ec2747cfbc21@redhat.com>
Date: Mon, 21 Jul 2025 12:10:36 +0200
From: David Hildenbrand <david@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
linux-doc@...r.kernel.org, Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Zi Yan <ziy@...dia.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Nico Pache <npache@...hat.com>,
Ryan Roberts <ryan.roberts@....com>, Dev Jain <dev.jain@....com>,
Barry Song <baohua@...nel.org>, Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...nel.org>, Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>, Usama Arif <usamaarif642@...il.com>,
SeongJae Park <sj@...nel.org>, Jann Horn <jannh@...gle.com>,
Yafang Shao <laoar.shao@...il.com>, Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH POC] prctl: extend PR_SET_THP_DISABLE to optionally
exclude VM_HUGEPAGE
Two additions:
>
> (E) Indicates "THP_enabled: 0" in /proc/pid/status only if THPs are not
> disabled completely
As raised off-list, this should be "only if THPs are disabled completely"
>
> Only indicating that THPs are disabled when they are really disabled
> completely, not only partially.
> > The documented semantics in the man page for PR_SET_THP_DISABLE
> "is inherited by a child created via fork(2) and is preserved across
> execve(2)" is maintained. This behavior, for example, allows for
> disabling THPs for a workload through the launching process (e.g.,
> systemd where we fork() a helper process to then exec()).
>
> There is currently not way to prevent that a process will not issue
> PR_SET_THP_DISABLE itself to re-enable THP. We could add a "seal" option
> to PR_SET_THP_DISABLE through another flag if ever required. The known
> users (such as redis) really use PR_SET_THP_DISABLE to disable THPs, so
> that is not added for now.
I don't think there is any user that would try re-enabling THPs through
that interface. It's kind-of against the original purpose (man page):
"Setting this flag provides a method for disabling transparent huge
pages for jobs where the code cannot be modified ..."
So if ever really required, one could investigate forbidding re-enabling
once disabled. But that obviously needs more investigation.
(also, if a workload ever enables THPs through that mechanism, probably
it is to blame)
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists