Linux Documentation
 help / color / mirror / Atom feed
From: "Li Zhe" <lizhe.67@bytedance.com>
To: <mingo@redhat.com>, <peterz@infradead.org>,
	<juri.lelli@redhat.com>,  <vincent.guittot@linaro.org>,
	<dietmar.eggemann@arm.com>,  <rostedt@goodmis.org>,
	<bsegall@google.com>, <mgorman@suse.de>,  <vschneid@redhat.com>,
	<kprateek.nayak@amd.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	 <linux-doc@vger.kernel.org>, <lizhe.67@bytedance.com>
Subject: [PATCH 4/4] Documentation: Describe per-process NUMA balancing control
Date: Tue,  8 Sep 2026 20:24:46 +0800	[thread overview]
Message-ID: <20260908122446.56708-5-lizhe.67@bytedance.com> (raw)
In-Reply-To: <20260908122446.56708-1-lizhe.67@bytedance.com>

Document the PR_SET_NUMA_BALANCING and PR_GET_NUMA_BALANCING operations
near the kernel.numa_balancing sysctl documentation, and describe the
NumaB_mode field in /proc/<pid>/status.

Signed-off-by: Li Zhe <lizhe.67@bytedance.com>
---
 Documentation/admin-guide/sysctl/kernel.rst | 16 ++++++++++++++++
 Documentation/filesystems/proc.rst          |  6 ++++++
 2 files changed, 22 insertions(+)

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index b6328cd0f43e..7f665c28828a 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -754,6 +754,22 @@ different types of memory (represented as different NUMA nodes) to
 place the hot pages in the fast memory.  This is implemented based on
 unmapping and page fault too.
 
+The ``PR_SET_NUMA_BALANCING`` and ``PR_GET_NUMA_BALANCING`` prctl(2)
+operations can be used by a process to opt out of automatic NUMA balancing
+or re-enable participation for the whole thread group.  Any thread in the
+thread group may change the process setting.  The setting is inherited by
+fork(2), is shared by threads created with clone(2) ``CLONE_THREAD`` and is
+preserved across execve(2).  The global ``numa_balancing`` sysctl remains
+the top-level control: a process-level enable does not turn automatic NUMA
+balancing on when it is disabled system-wide.  Memory policy still applies,
+so the process setting does not make VMAs participate when their policy
+prevents automatic NUMA balancing.
+
+Disabling the process setting stops scheduling new periodic NUMA scans for
+that process. Existing NUMA hinting PTEs and already queued work are not
+actively cleared and may still drain naturally as the disabled state takes
+effect.
+
 numa_balancing_promote_rate_limit_MBps
 ======================================
 
diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
index c102b62023cd..a4e9037a3161 100644
--- a/Documentation/filesystems/proc.rst
+++ b/Documentation/filesystems/proc.rst
@@ -188,6 +188,7 @@ read the file /proc/PID/status::
   HugetlbPages:          0 kB
   CoreDumping:    0
   THP_enabled:	  1
+  NumaB_mode:     enabled
   Threads:        1
   SigQ:   0/28578
   SigPnd: 0000000000000000
@@ -274,6 +275,11 @@ It's slow but very precise.
  THP_enabled                 process is allowed to use THP (returns 0 when
                              PR_SET_THP_DISABLE is set on the process to disable
                              THP completely, not just partially)
+ NumaB_mode                  process automatic NUMA balancing mode:
+                             enabled or disabled when supported, otherwise
+                             unsupported; the effective behavior also depends
+                             on the global numa_balancing sysctl and memory
+                             policy
  Threads                     number of threads
  SigQ                        number of signals queued/max. number for queue
  SigPnd                      bitmap of pending signals for the thread
-- 
2.20.1

      parent reply	other threads:[~2026-09-08 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 12:24 [PATCH 0/4] sched/numa: Add per-process automatic NUMA balancing control Li Zhe
2026-09-08 12:24 ` [PATCH 1/4] sched/numa: Track per-process automatic NUMA balancing mode Li Zhe
2026-09-08 12:24 ` [PATCH 2/4] sched/numa: Add prctl controls for process mode Li Zhe
2026-09-08 12:24 ` [PATCH 3/4] proc: Report process NUMA balancing mode Li Zhe
2026-09-08 12:24 ` Li Zhe [this message]

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=20260908122446.56708-5-lizhe.67@bytedance.com \
    --to=lizhe.67@bytedance.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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