Add get_mempolicy, set_mempolicy NUMA syscalls#193
Open
wingo wants to merge 1 commit into
Open
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) |
Owner
There was a problem hiding this comment.
The CI is objecting to the 1ULL in bit.lshift
Owner
There was a problem hiding this comment.
I think that may be luajit 2.1 vs 2.0 issue, about 64 bit bitops. Would be nice to work around...
Owner
|
There are a few CI issues. For automated tests you should be able to at least call |
Contributor
Author
|
Tx for the feedback, will poke. |
Owner
|
Would be nice to fix the CI issues... |
Contributor
Author
|
tx for the ping, will poke |
Contributor
Author
|
Related: snabbco/snabb#1200 I should get back on this upstreaming horse! |
Owner
|
Yes I think https://github.com/snabbco/snabb/pull/1268/files is needed... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.