Skip to content

Commit

Permalink
Merge 'eugeneia/numa-selftest-nonnuma' into wingo-next
Browse files Browse the repository at this point in the history
Fixes #1269.
  • Loading branch information
wingo committed Jun 4, 2018
2 parents bb935c7 + 2ece0c1 commit 3120d7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/numa.lua
Expand Up @@ -109,6 +109,7 @@ function unbind_numa_node ()
end

function bind_to_numa_node (node)
if not has_numa() then return end
if node == bound_numa_node then return end
if not node then return unbind_numa_node() end
assert(not bound_numa_node, "already bound")
Expand All @@ -135,11 +136,11 @@ function selftest ()
assert(bound_cpu == cpu)
assert(bound_numa_node == node)
assert(S.getcpu().cpu == cpu)
assert(S.getcpu().node == node)
assert(not has_numa() or S.getcpu().node == node)
bind_to_cpu(nil)
assert(bound_cpu == nil)
assert(bound_numa_node == node)
assert(S.getcpu().node == node)
assert(not has_numa() or S.getcpu().node == node)
bind_to_numa_node(nil)
assert(bound_cpu == nil)
assert(bound_numa_node == nil)
Expand Down

0 comments on commit 3120d7c

Please sign in to comment.