From: Usama Arif <usamaarif642@gmail.com>
To: alx@kernel.org
Cc: linux-man@vger.kernel.org, david@redhat.com,
lorenzo.stoakes@oracle.com, hannes@cmpxchg.org,
baohua@kernel.org, shakeel.butt@linux.dev, ziy@nvidia.com,
laoar.shao@gmail.com, baolin.wang@linux.alibaba.com,
Liam.Howlett@oracle.com, linux-kernel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH v2] PR_*ET_THP_DISABLE.2const: document addition of PR_THP_DISABLE_EXCEPT_ADVISED
Date: Wed, 5 Nov 2025 16:49:30 +0300 [thread overview]
Message-ID: <017b23d3-28e1-4785-8334-b3b3f9800e2a@gmail.com> (raw)
In-Reply-To: <20251105134811.3170745-1-usamaarif642@gmail.com>
On 05/11/2025 16:48, Usama Arif wrote:
> PR_THP_DISABLE_EXCEPT_ADVISED extended PR_SET_THP_DISABLE to only provide
> THPs when advised. IOW, it allows individual processes to opt-out of THP =
> "always" into THP = "madvise", without affecting other workloads on the
> system. The series has been merged in [1]. Before [1], the following 2
> calls were allowed with PR_SET_THP_DISABLE:
>
> prctl(PR_SET_THP_DISABLE, 0, 0, 0, 0); // to reset THP setting.
> prctl(PR_SET_THP_DISABLE, 1, 0, 0, 0); // to disable THPs completely.
>
> Now in addition to the 2 calls above, you can do:
>
> prctl(PR_SET_THP_DISABLE, 1, PR_THP_DISABLE_EXCEPT_ADVISED, 0, 0); // to
> disable THPs except madvise.
>
> This patch documents the changes introduced due to the addition of
> PR_THP_DISABLE_EXCEPT_ADVISED flag:
> - PR_GET_THP_DISABLE returns a value whose bits indicate how THP-disable
> is configured for the calling thread (with or without
> PR_THP_DISABLE_EXCEPT_ADVISED).
> - PR_SET_THP_DISABLE now uses arg3 to specify whether to disable THP
> completely for the process, or disable except madvise
> (PR_THP_DISABLE_EXCEPT_ADVISED).
>
> [1] https://github.com/torvalds/linux/commit/9dc21bbd62edeae6f63e6f25e1edb7167452457b
>
> Signed-off-by: Usama Arif <usamaarif642@gmail.com>
> ---
> v1 -> v2 (Alejandro Colomar):
> - Fixed double negation on when MADV_HUGEPAGE will succeed
> - Turn return values of PR_GET_THP_DISABLE into a table
> - Turn madvise calls into full italics
> - Use semantic newlines
> ---
> man/man2/madvise.2 | 6 ++-
> man/man2const/PR_GET_THP_DISABLE.2const | 20 +++++++---
> man/man2const/PR_SET_THP_DISABLE.2const | 52 +++++++++++++++++++++----
> 3 files changed, 64 insertions(+), 14 deletions(-)
>
Resending this for review as the patch to implement this is in merged [1]
[1] https://github.com/torvalds/linux/commit/9dc21bbd62edeae6f63e6f25e1edb7167452457b
next prev parent reply other threads:[~2025-11-05 13:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 13:48 Usama Arif
2025-11-05 13:49 ` Usama Arif [this message]
2025-11-09 12:01 ` Alejandro Colomar
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=017b23d3-28e1-4785-8334-b3b3f9800e2a@gmail.com \
--to=usamaarif642@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=alx@kernel.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=laoar.shao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=shakeel.butt@linux.dev \
--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
all inboxes | Powered by JetHome®