mm, security, bpf: Fine-grained control over memory policy adjustments with lsm bpf
Subsystems (9)
v3 cover mm, security, bpf: Fine-grained control over memory policy adjustments with lsm bpf
Background
==========
In our containerized environment, we've identified unexpected OOM events where the OOM-killer terminates tasks despite having ample free memory. This anomaly is traced back to tasks within a container using mbind(2) to bind memory to a specific NUMA node. When the allocated memory on this node is exhausted, the OOM-killer, prioritizing tasks based on oom_score, indiscriminately kills tasks.
The Challenge
=============
In a containerized environment, independent memory binding by a user can lead to unexpected system issues or disrupt tasks being run by other users on the same server. If a user genuinely requires memory binding, we will allocate dedicated servers to them by leveraging kubelet deployment.
Currently, users possess the ability to autonomously bind their memory to specific nodes without explicit agreement or authorization from our end. It's imperative that we establish a method to prevent this behavior.
Proposed Solution
=================
- Capability
Currently, any task can perform MPOL_BIND without specific capabilities. Enforcing CAP_SYS_RESOURCE or CAP_SYS_NICE could be an option, but this may have unintended consequences. Capabilities, being broad, might grant unnecessary privileges. We should explore alternatives to prevent unexpected side effects.
- LSM
Introduce LSM hooks for syscalls such as mbind(2) and set_mempolicy(2) to disable MPOL_BIND. This approach is more flexibility and allows for fine-grained control without unintended consequences. A sample LSM BPF program is included, demonstrating practical implementation in a production environment.
- seccomp
seccomp is relatively heavyweight, making it less suitable for enabling in our production environment:
- Both kubelet and containers need adaptation to support it.
- Dynamically altering security policies for individual containers without interrupting their operations isn't straightforward.
Future Considerations
=====================
In addition, there's room for enhancement in the OOM-killer for cases involving CONSTRAINT_MEMORY_POLICY. It would be more beneficial to prioritize selecting a victim that has allocated memory on the same NUMA node. My exploration on the lore led me to a proposal[0] related to this matter, although consensus seems elusive at this point. Nevertheless, delving into this specific topic is beyond the scope of the current patchset.
[0]. https://lore.kernel.org/lkml/[email protected]/
Changes:
- RCC v2 -> v3:
- Add MPOL_F_NUMA_BALANCING man-page (Ying)
- Fix bpf selftests error reported by bot+bpf-ci
- RFC v1 -> RFC v2: https://lwn.net/Articles/952339/
- Refine the commit log to avoid misleading
- Use one common lsm hook instead and add comment for it
- Add selinux implementation
- Other improments in mempolicy
- RFC v1: https://lwn.net/Articles/951188/
Yafang Shao (6):
mm, doc: Add doc for MPOL_F_NUMA_BALANCING
mm: mempolicy: Revise comment regarding mempolicy mode flags mm, security: Fix missed security_task_movememory() mm, security: Add lsm hook for memory policy adjustment
security: selinux: Implement set_mempolicy hook selftests/bpf: Add selftests for set_mempolicy with a lsm prog
.../admin-guide/mm/numa_memory_policy.rst | 27 +++++++ include/linux/lsm_hook_defs.h | 3 + include/linux/security.h | 9 +++ include/uapi/linux/mempolicy.h | 2 +- mm/mempolicy.c | 22 ++++- security/security.c | 13 +++ security/selinux/hooks.c | 8 ++ security/selinux/include/classmap.h | 2 +- .../selftests/bpf/prog_tests/set_mempolicy.c | 81 +++++++++++++++++++ .../selftests/bpf/progs/test_set_mempolicy.c | 28 +++++++ 10 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/set_mempolicy.c create mode 100644 tools/testing/selftests/bpf/progs/test_set_mempolicy.c
NOT kernel:
Yafang Shao (1):
NOT kernel/man2/mbind.2: Add mode flag MPOL_F_NUMA_BALANCING
Signature · 1 line
2.30.1 (Apple Git-130)
PATCH v3 1/7 mm, doc: Add doc for MPOL_F_NUMA_BALANCING
The document on MPOL_F_NUMA_BALANCING was missed in the initial commit The MPOL_F_NUMA_BALANCING document was inadvertently omitted from the initial commit bda420b98505 ("numa balancing: migrate on fault among multiple bound nodes")
Let's ensure its inclusion.
--- .../admin-guide/mm/numa_memory_policy.rst | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+)
Documentation/admin-guide/mm/numa_memory_policy.rst +27 -0
@@ -332,6 +332,33 @@ MPOL_F_RELATIVE_NODES MPOL_PREFERRED policies that were created with an empty nodemask (local allocation). +MPOL_F_NUMA_BALANCING (since Linux 5.12) + When operating in MPOL_BIND mode, enables NUMA balancing for tasks, + contingent upon kernel support. This feature optimizes page + placement within the confines of the specified memory binding + policy. The addition of the MPOL_F_NUMA_BALANCING flag augments the + control mechanism for NUMA balancing: + + - The sysctl knob numa_balancing governs global activation or + deactivation of NUMA balancing. + + - Even if sysctl numa_balancing is enabled, NUMA balancing remains + disabled by default for memory areas or applications utilizing + explicit memory policies. + + - The MPOL_F_NUMA_BALANCING flag facilitates NUMA balancing + activation for applications employing explicit memory policies + (MPOL_BIND). + + This flags enables various optimizations for page placement through + NUMA balancing. For instance, when an application's memory is bound + to multiple nodes (MPOL_BIND), the hint page fault handler attempts + to migrate accessed pages to reduce cross-node access if the + accessing node aligns with the policy nodemask. + + If the flag isn't supported by the kernel, or is used with mode + other than MPOL_BIND, -1 is returned and errno is set to EINVAL. + Memory Policy Reference Counting ================================
Signature · 1 line
2.30.1 (Apple Git-130)
PATCH v3 2/7 mm: mempolicy: Revise comment regarding mempolicy mode flags
In reply to Yafang ShaoMPOL_F_STATIC_NODES, MPOL_F_RELATIVE_NODES, and MPOL_F_NUMA_BALANCING are mode flags applicable to both set_mempolicy(2) and mbind(2) system calls. It's worth noting that MPOL_F_NUMA_BALANCING was initially introduced in commit bda420b98505 ("numa balancing: migrate on fault among multiple bound nodes") exclusively for set_mempolicy(2). However, it was later made a shared flag for both set_mempolicy(2) and mbind(2) following commit 6d2aec9e123b ("mm/mempolicy: do not allow illegal MPOL_F_NUMA_BALANCING | MPOL_LOCAL in mbind()").
This revised version aims to clarify the details regarding the mode flags.
--- include/uapi/linux/mempolicy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/mempolicy.h +1 -1
@@ -26,7 +26,7 @@ enum { MPOL_MAX, /* always last member of enum */ }; -/* Flags for set_mempolicy */ +/* Flags for set_mempolicy() or mbind() */ #define MPOL_F_STATIC_NODES (1 << 15)#define MPOL_F_RELATIVE_NODES (1 << 14)#define MPOL_F_NUMA_BALANCING (1 << 13)/* Optimize with NUMA balancing if possible */
Signature · 1 line
2.30.1 (Apple Git-130)
PATCH v3 3/7 mm, security: Fix missed security_task_movememory()
In reply to Yafang ShaoConsidering that MPOL_F_NUMA_BALANCING or mbind(2) using either MPOL_MF_MOVE or MPOL_MF_MOVE_ALL are capable of memory movement, it's essential to include security_task_movememory() to cover this functionality as well. It was identified during a code review.
--- mm/mempolicy.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
mm/mempolicy.c +13 -1
@@ -1259,8 +1259,15 @@ static long do_mbind(unsigned long start, unsigned long len,if (!new) flags |=MPOL_MF_DISCONTIG_OK ; -if (flags & (MPOL_MF_MOVE |MPOL_MF_MOVE_ALL )) +if (flags & (MPOL_MF_MOVE |MPOL_MF_MOVE_ALL )) { + err =security_task_movememory (current); +if (err) { +mpol_put (new); +return err; + }lru_cache_disable (); + } + {NODEMASK_SCRATCH (scratch);if (scratch) {
@@ -1450,6 +1457,8 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode,/* Basic parameter sanity check used by both mbind() and set_mempolicy() */ static inline int sanitize_mpol_flags (int *mode,unsigned short *flags) { +int err; + *flags = *mode &MPOL_MODE_FLAGS ; *mode &= ~MPOL_MODE_FLAGS ;
@@ -1460,6 +1469,9 @@ static inline int sanitize_mpol_flags(int *mode, unsigned short *flags)if (*flags &MPOL_F_NUMA_BALANCING ) {if (*mode !=MPOL_BIND )return -EINVAL ; + err =security_task_movememory (current); +if (err) +return err; *flags |= (MPOL_F_MOF |MPOL_F_MORON ); }return 0 ;
Signature · 1 line
2.30.1 (Apple Git-130)
Serge E. Hallyn
maintainerRe: [PATCH v3 3/7] mm, security: Fix missed security_task_movememory()
Quoted 4 lines · Yafang Shao
Considering that
MPOL_F_NUMA_BALANCINGor mbind(2) using eitherMPOL_MF_MOVEorMPOL_MF_MOVE_ALLare capable of memory movement, it's essential to includesecurity_task_movememory()to cover this functionality as well. It was identified during a code review.
Hm - this doesn't have any bad side effects for you when using selinux? The selinux_task_movememory() hook checks for PROCESS__SETSCHED privs. The two existing security_task_movememory() calls are in cases where we expect the caller to be affecting another task identified by pid, so that makes sense. Is an MPOL_MV_MOVE to move your own pages actually analogous to that?
Much like the concern you mentioned in your intro about requiring CAP_SYS_NICE and thereby expanding its use, it seems that here you will be regressing some mbind users unless the granting of PROCESS__SETSCHED is widened.
Quoted 10 lines
Signed-off-by Yafang Shao <[email protected]>--- mm/mempolicy.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)mm/mempolicy.c +0
-0
mm/mempolicy.c static long do_mbind(unsigned long start, unsigned long len, · line 1262
Quoted 5 lines
mm/mempolicy.c +1
-1@@ -1259,8 +1259,15 @@ static long do_mbind(unsigned long start, unsigned long len,if (!new) flags |=MPOL_MF_DISCONTIG_OK ; -if (flags & (MPOL_MF_MOVE |MPOL_MF_MOVE_ALL )) +if (flags & (MPOL_MF_MOVE |MPOL_MF_MOVE_ALL )) {
MPOL_MF_MOVE_ALL already has a CAP_SYS_NICE check. Does that suffice for that one?
Quoted 32 lines
mm/mempolicy.c +12
-0+ err =security_task_movememory (current); +if (err) { +mpol_put (new); +return err; + }lru_cache_disable (); + } + {NODEMASK_SCRATCH (scratch);if (scratch) {@@ -1450,6 +1457,8 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode,/* Basic parameter sanity check used by both mbind() and set_mempolicy() */ static inline int sanitize_mpol_flags (int *mode,unsigned short *flags) { +int err; + *flags = *mode &MPOL_MODE_FLAGS ; *mode &= ~MPOL_MODE_FLAGS ;@@ -1460,6 +1469,9 @@ static inline int sanitize_mpol_flags(int *mode, unsigned short *flags)if (*flags &MPOL_F_NUMA_BALANCING ) {if (*mode !=MPOL_BIND )return -EINVAL ; + err =security_task_movememory (current); +if (err) +return err; *flags |= (MPOL_F_MOF |MPOL_F_MORON ); }return 0 ;Signature · 1 line
2.30.1 (Apple Git-130)
Re: [PATCH v3 3/7] mm, security: Fix missed security_task_movememory()
Quoted 14 lines · Serge E. Hallyn
Quoted 4 lines · Yafang Shao
Considering that
MPOL_F_NUMA_BALANCINGor mbind(2) using eitherMPOL_MF_MOVEorMPOL_MF_MOVE_ALLare capable of memory movement, it's essential to includesecurity_task_movememory()to cover this functionality as well. It was identified during a code review.Hm - this doesn't have any bad side effects for you when using selinux? The
selinux_task_movememory()hook checks forPROCESS__SETSCHEDprivs. The two existingsecurity_task_movememory()calls are in cases where we expect the caller to be affecting another task identified by pid, so that makes sense. Is anMPOL_MV_MOVEto move your own pages actually analogous to that?
Quoted 4 lines
Much like the concern you mentioned in your intro about requiring
CAP_SYS_NICEand thereby expanding its use, it seems that here you will be regressing some mbind users unless the granting ofPROCESS__SETSCHEDis widened.
Ah, it appears that this change might lead to regression. I overlooked its association with the PROCESS__SETSCHED privilege. I'll exclude this patch from the upcoming version.
Thanks for your review.
Signature · 2 lines
Regards Yafang
PATCH v3 4/7 mm, security: Add lsm hook for memory policy adjustment
In reply to Yafang ShaoIn a containerized environment, independent memory binding by a user can lead to unexpected system issues or disrupt tasks being run by other users on the same server. If a user genuinely requires memory binding, we will allocate dedicated servers to them by leveraging kubelet deployment.
At present, users have the capability to bind their memory to a specific node without explicit agreement or authorization from us. Consequently, a new LSM hook is introduced to mitigate this. This implementation allows us to exercise fine-grained control over memory policy adjustments within our container environment
--- include/linux/lsm_hook_defs.h | 3 +++ include/linux/security.h | 9 +++++++++ mm/mempolicy.c | 8 ++++++++ security/security.c | 13 +++++++++++++ 4 files changed, 33 insertions(+)
include/linux/lsm_hook_defs.h +3 -0
@@ -419,3 +419,6 @@ LSM_HOOK(int, 0, uring_override_creds, const struct cred *new) LSM_HOOK(int, 0, uring_sqpoll, void) LSM_HOOK(int, 0, uring_cmd, struct io_uring_cmd *ioucmd)#endif /* CONFIG_IO_URING */ + +LSM_HOOK(int, 0, set_mempolicy, unsigned long mode, unsigned short mode_flags, + nodemask_t *nmask, unsigned int flags)
include/linux/security.h +9 -0
@@ -484,6 +484,8 @@ int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);int security_inode_setsecctx (struct dentry *dentry,void *ctx,u32 ctxlen);int security_inode_getsecctx (struct inode *inode,void **ctx,u32 *ctxlen);int security_locked_down (enum lockdown_reason what); +int security_set_mempolicy (unsigned long mode,unsigned short mode_flags, +nodemask_t *nmask,unsigned int flags);#else /* CONFIG_SECURITY */ static inline int call_blocking_lsm_notifier (enum lsm_event event,void *data)
@@ -1395,6 +1397,13 @@ static inline int security_locked_down(enum lockdown_reason what) {return 0 ; } + +static inline int +security_set_mempolicy (unsigned long mode,unsigned short mode_flags, +nodemask_t *nmask,unsigned int flags) +{ +return 0 ; +}#endif /* CONFIG_SECURITY */ #if defined(CONFIG_SECURITY ) && defined(CONFIG_WATCH_QUEUE )
mm/mempolicy.c +8 -0
@@ -1495,6 +1495,10 @@ static long kernel_mbind(unsigned long start, unsigned long len,if (err)return err; + err =security_set_mempolicy (lmode, mode_flags, &nodes, flags); +if (err) +return err; +return do_mbind (start, len, lmode, mode_flags, &nodes, flags); }
@@ -1589,6 +1593,10 @@ static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask,if (err)return err; + err =security_set_mempolicy (lmode, mode_flags, &nodes,0 ); +if (err) +return err; +return do_set_mempolicy (lmode, mode_flags, &nodes); }
security/security.c +13 -0
@@ -5337,3 +5337,16 @@ int security_uring_cmd(struct io_uring_cmd *ioucmd) return call_int_hook(uring_cmd, 0, ioucmd); }#endif /* CONFIG_IO_URING */ + +/** +* security_set_mempolicy() - Check if memory policy can be adjusted +* @mode: The memory policy mode to be set +* @mode_flags: optional mode flags +* @nmask: modemask to which the mode applies +* @flags: mode flags for mbind(2) only +*/ +int security_set_mempolicy (unsigned long mode,unsigned short mode_flags, +nodemask_t *nmask,unsigned int flags) +{ +return call_int_hook (set_mempolicy,0 , mode, mode_flags, nmask, flags); +}
Signature · 1 line
2.30.1 (Apple Git-130)
PATCH v3 5/7 security: selinux: Implement set_mempolicy hook
In reply to Yafang ShaoAdd a SELinux access control for the newly introduced set_mempolicy lsm hook. A new permission "setmempolicy" is defined under the "process" class for it.
--- security/selinux/hooks.c | 8 ++++++++ security/selinux/include/classmap.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
security/selinux/hooks.c +8 -0
@@ -4238,6 +4238,13 @@ static int selinux_userns_create(const struct cred *cred) USER_NAMESPACE__CREATE, NULL); } +static int selinux_set_mempolicy (unsigned long mode,unsigned short mode_flags, +nodemask_t *nmask,unsigned int flags) +{ +return avc_has_perm (current_sid (),task_sid_obj (current),SECCLASS_PROCESS , +PROCESS__SETMEMPOLICY ,NULL ); +} +/* Returns error only if unable to parse addresses */ static int selinux_parse_skb_ipv4 (struct sk_buff *skb,struct common_audit_data *ad,u8 *proto)
@@ -7072,6 +7079,7 @@ static struct security_hook_list selinux_hooks[] __ro_after_init = {LSM_HOOK_INIT (task_kill, selinux_task_kill),LSM_HOOK_INIT (task_to_inode, selinux_task_to_inode),LSM_HOOK_INIT (userns_create, selinux_userns_create), +LSM_HOOK_INIT (set_mempolicy, selinux_set_mempolicy),LSM_HOOK_INIT (ipc_permission, selinux_ipc_permission), LSM_HOOK_INIT(ipc_getsecid, selinux_ipc_getsecid),
security/selinux/include/classmap.h +1 -1
@@ -51,7 +51,7 @@ const struct security_class_mapping secclass_map[] = {"getattr" ,"setexec" ,"setfscreate" ,"noatsecure" ,"siginh" ,"setrlimit" ,"rlimitinh" ,"dyntransition" ,"setcurrent" ,"execmem" ,"execstack" ,"execheap" ,"setkeycreate" , - "setsockcreate", "getrlimit", NULL } }, + "setsockcreate", "getrlimit", "setmempolicy", NULL } }, { "process2", { "nnp_transition", "nosuid_transition", NULL } }, { "system",
Signature · 1 line
2.30.1 (Apple Git-130)
PATCH v3 6/7 selftests/bpf: Add selftests for set_mempolicy with a lsm prog
In reply to Yafang ShaoThe result as follows,
#261/1 set_mempolicy/MPOL_BIND_with_lsm:OK #261/2 set_mempolicy/MPOL_DEFAULT_with_lsm:OK #261/3 set_mempolicy/MPOL_BIND_without_lsm:OK #261/4 set_mempolicy/MPOL_DEFAULT_without_lsm:OK #261 set_mempolicy:OK
Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED
--- .../selftests/bpf/prog_tests/set_mempolicy.c | 81 +++++++++++++++++++ .../selftests/bpf/progs/test_set_mempolicy.c | 28 +++++++ 2 files changed, 109 insertions(+) create mode 100644 tools/testing/selftests/bpf/prog_tests/set_mempolicy.c create mode 100644 tools/testing/selftests/bpf/progs/test_set_mempolicy.c
tools/testing/selftests/bpf/prog_tests/set_mempolicy.c new file +81 -0
@@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (C) 2023 Yafang Shao <[email protected]> */ + +#include <unistd.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <linux/mempolicy.h> +#include <test_progs.h> +#include "test_set_mempolicy.skel.h" + +#define SIZE 4096 + +static void mempolicy_bind (bool success) +{ +unsigned long mask =1 ; +char *addr; +int err; + + addr =mmap (NULL ,SIZE ,PROT_READ |PROT_WRITE ,MAP_PRIVATE |MAP_ANONYMOUS ,-1 ,0 ); +if (!ASSERT_OK_PTR (addr,"mmap" )) +return ; + +/* -lnuma is required by mbind(2), so use __NR_mbind to avoid the dependency. */ + err =syscall (__NR_mbind, addr,SIZE ,MPOL_BIND , &mask,sizeof (mask),0 ); +if (success) +ASSERT_OK (err,"mbind_success" ); +else +ASSERT_ERR (err,"mbind_fail" ); + +munmap (addr,SIZE ); +} + +static void mempolicy_default (void ) +{ +char *addr; +int err; + + addr =mmap (NULL ,SIZE ,PROT_READ |PROT_WRITE ,MAP_PRIVATE |MAP_ANONYMOUS ,-1 ,0 ); +if (!ASSERT_OK_PTR (addr,"mmap" )) +return ; + + err =syscall (__NR_mbind, addr,SIZE ,MPOL_DEFAULT ,NULL ,0 ,0 ); +ASSERT_OK (err,"mbind_success" ); + +munmap (addr,SIZE ); +} + +void test_set_mempolicy (void ) +{ +struct test_set_mempolicy *skel; +int err; + + skel =test_set_mempolicy__open (); +if (!ASSERT_OK_PTR (skel,"open" )) +return ; + + skel->bss->target_pid =getpid (); + + err =test_set_mempolicy__load (skel); +if (!ASSERT_OK (err,"load" )) + goto destroy; + +/* Attach LSM prog first */ + err =test_set_mempolicy__attach (skel); +if (!ASSERT_OK (err,"attach" )) + goto destroy; + +/* syscall to adjust memory policy */ +if (test__start_subtest ("MPOL_BIND_with_lsm" )) +mempolicy_bind (false); +if (test__start_subtest ("MPOL_DEFAULT_with_lsm" )) +mempolicy_default (); + +destroy: +test_set_mempolicy__destroy (skel); + +if (test__start_subtest ("MPOL_BIND_without_lsm" )) +mempolicy_bind (true); +if (test__start_subtest ("MPOL_DEFAULT_without_lsm" )) +mempolicy_default (); +}
tools/testing/selftests/bpf/progs/test_set_mempolicy.c new file +28 -0
@@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (C) 2023 Yafang Shao <[email protected]> */ + +#include "vmlinux.h" +#include <bpf/bpf_helpers.h> +#include <bpf/bpf_tracing.h> + +int target_pid; + +static int mem_policy_adjustment (u64 mode) +{ +struct task_struct *task =bpf_get_current_task_btf (); + +if (task->pid != target_pid) +return 0 ; + +if (mode !=MPOL_BIND ) +return 0 ; +return -1 ; +} + +SEC("lsm/set_mempolicy") +int BPF_PROG (setmempolicy ,u64 mode,u16 mode_flags,nodemask_t *nmask,u32 flags) +{ +return mem_policy_adjustment (mode); +} + +char _license[] SEC("license") = "GPL";
Signature · 1 line
2.30.1 (Apple Git-130)
PATCH v3 7/7 NOT kernel/man2/mbind.2: Add mode flag MPOL_F_NUMA_BALANCING
In reply to Yafang ShaoIn Linux Kernel 5.12, a new mode flag, MPOL_F_NUMA_BALANCING, was added to set_mempolicy() to optimize the page placement among the NUMA nodes with the NUMA balancing mechanism even if the memory of the applications is bound with MPOL_BIND.
In Linux Kernel 5.15, this mode flag was extended to mbind(2). Let's also add man-page for mbind(2). It is copied from set_mempoicy(2) man-page with subtle modifications.
Related kernel commits:bda420b985054a3badafef23807c4b4fa38a3dff6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c
--- man2/mbind.2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
man2/mbind.2 +17 -0
@@ -142,6 +142,23 @@ The supported .I "mode flags" are: .TP +.BR MPOL_F_NUMA_BALANCING " (since Linux 5.15)" +.\" commit bda420b985054a3badafef23807c4b4fa38a3dff +.\" commit 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c +When +.I mode +is +.BR MPOL_BIND , +enable the kernel NUMA balancing for the task if it is supported by the kernel. +If the flag isn't supported by the kernel, or is used with +.I mode +other than +.BR MPOL_BIND , +\-1 is returned and +.I errno +is set to +.BR EINVAL . +.TP .BR MPOL_F_STATIC_NODES " (since Linux-2.6.26)" A nonempty .I nodemask
Signature · 1 line
2.39.3