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//status. Signed-off-by: Li Zhe --- 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