summaryrefslogtreecommitdiffhomepage
path: root/pkg/abi
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2019-06-06 16:27:09 -0700
committerShentubot <shentubot@google.com>2019-06-06 16:29:46 -0700
commitb3f104507d7a04c0ca058cbcacc5ff78d853f4ba (patch)
treefb45110e8c9329b16165a92e67edb2c184de0dd6 /pkg/abi
parenta26043ee53a2f38b81c9eaa098d115025e87f4c3 (diff)
"Implement" mbind(2).
We still only advertise a single NUMA node, and ignore mempolicy accordingly, but mbind() at least now succeeds and has effects reflected by get_mempolicy(). Also fix handling of nodemasks: round sizes to unsigned long (as documented and done by Linux), and zero trailing bits when copying them out. PiperOrigin-RevId: 251950859
Diffstat (limited to 'pkg/abi')
-rw-r--r--pkg/abi/linux/mm.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/abi/linux/mm.go b/pkg/abi/linux/mm.go
index 0b02f938a..cd043dac3 100644
--- a/pkg/abi/linux/mm.go
+++ b/pkg/abi/linux/mm.go
@@ -114,3 +114,12 @@ const (
MPOL_MODE_FLAGS = (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)
)
+
+// Flags for mbind(2).
+const (
+ MPOL_MF_STRICT = 1 << 0
+ MPOL_MF_MOVE = 1 << 1
+ MPOL_MF_MOVE_ALL = 1 << 2
+
+ MPOL_MF_VALID = MPOL_MF_STRICT | MPOL_MF_MOVE | MPOL_MF_MOVE_ALL
+)