-
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
Upstream lwaftr ljsyscall changes #203
base: master
Are you sure you want to change the base?
Upstream lwaftr ljsyscall changes #203
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.
* lib/ljsyscall/syscall/linux/c.lua: * lib/ljsyscall/syscall/linux/syscalls.lua: Add support for the migrate_pages Linux syscall.
Thanks! I think the CI is failing because of LuaJIT 2.0 vs 2.1 differences. I don't really want to break 2.0 yet, even though most people use 2.1. I think it should be possible to work around the differences, will take a look. |
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.
Need to use 1
instead of 1ULL
so that luajit 2.0 doesn't fail
That won't give the right result though... On 28 Oct 2016 8:15 p.m., "daurnimator" [email protected] wrote:
|
This has significant (but not total) overlap with #193. The numa/mempolicy code is the same, but this one also includes the migrate_pages patch. |
@kbara its not just the syntax, 2.0 does not have 64 bit shifts. There are some compatibility functions for 64 bit shifts here https://github.com/justincormack/ljsyscall/blob/master/syscall/bit.lua |
Yeah - that was a hastily-written patch based on some Jabber discussion, which I should revert. Sorry for the noise. |
0b6c6ec
to
7122cf4
Compare
Hi @justincormack ,
@wingo wrote a couple of patches to ljsyscall, which we've been using in the lwaftr. As per discussion with him, here's a PR upstreaming them. They deal with mempolicy/numa/page migration.