-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add get_mempolicy, set_mempolicy NUMA syscalls #193
base: master
Are you sure you want to change the base?
Conversation
Calling get_mempolicy() will return an object with "mode" and "mask" keys, corresponding to the two output arguments of the get_mempolicy function. The mask is implemented along the lines of cpu_set, except that it can hold any number of bits, defaulting to the size of a long. set_mempolicy(mode, mask) imposes a mode and possibly a mask as well.
local ulong_bit_count = ffi.sizeof('unsigned long') * 8 | ||
local function ulong_index_and_bit(n) | ||
local i = math.floor(n / ulong_bit_count) | ||
local b = bit.lshift(1ULL, n - i * ulong_bit_count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI is objecting to the 1ULL
in bit.lshift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that may be luajit 2.1 vs 2.0 issue, about 64 bit bitops. Would be nice to work around...
There are a few CI issues. For automated tests you should be able to at least call |
Tx for the feedback, will poke. |
Would be nice to fix the CI issues... |
tx for the ping, will poke |
Related: snabbco/snabb#1200 I should get back on this upstreaming horse! |
Yes I think https://github.com/snabbco/snabb/pull/1268/files is needed... |
Calling get_mempolicy() will return an object with "mode" and "mask"
keys, corresponding to the two output arguments of the get_mempolicy
function. The mask is implemented along the lines of cpu_set, except
that it can hold any number of bits, defaulting to the size of a long.
set_mempolicy(mode, mask) imposes a mode and possibly a mask as well.
I have tested this in Snabb and interactively but I would appreciate suggestions on what automated tests would be required.