linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Zi Yan <ziy@nvidia.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Vlastimil Babka <vbabka@suse.cz>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Usama Arif <usamaarif642@gmail.com>,
	SeongJae Park <sj@kernel.org>, Jann Horn <jannh@google.com>,
	Yafang Shao <laoar.shao@gmail.com>,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH POC] prctl: extend PR_SET_THP_DISABLE to optionally exclude VM_HUGEPAGE
Date: Mon, 21 Jul 2025 12:10:36 +0200	[thread overview]
Message-ID: <5dffdbca-c576-489c-b84a-ec2747cfbc21@redhat.com> (raw)
In-Reply-To: <20250721090942.274650-1-david@redhat.com>

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


  reply	other threads:[~2025-07-21 10:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21  9:09 [PATCH POC] prctl: extend PR_SET_THP_DISABLE to optionally exclude VM_HUGEPAGE David Hildenbrand
2025-07-21 10:10 ` David Hildenbrand [this message]
2025-07-21 11:28 ` Lorenzo Stoakes
2025-07-21 11:45   ` David Hildenbrand
2025-07-21 13:15     ` Lorenzo Stoakes
2025-07-21 14:32 ` Usama Arif
2025-07-21 14:39   ` David Hildenbrand
2025-07-21 17:27 ` Usama Arif
2025-07-21 19:35   ` SeongJae Park
2025-07-22 10:23   ` David Hildenbrand
2025-07-22 10:27     ` Lorenzo Stoakes
2025-07-23 17:07     ` Usama Arif
2025-07-23 18:02       ` David Hildenbrand
2025-07-24 18:57 ` Usama Arif
2025-07-24 19:07   ` David Hildenbrand
2025-07-24 22:27     ` Usama Arif
2025-07-25 13:08       ` David Hildenbrand
2025-07-25 16:26         ` Usama Arif

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=5dffdbca-c576-489c-b84a-ec2747cfbc21@redhat.com \
    --to=david@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=corbet@lwn.net \
    --cc=dev.jain@arm.com \
    --cc=jannh@google.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-doc@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=mhocko@suse.com \
    --cc=npache@redhat.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=sj@kernel.org \
    --cc=surenb@google.com \
    --cc=usamaarif642@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).