justincormack / ljsyscall

LuaJIT Unix syscall FFI
http://www.myriabit.com/ljsyscall/
Other
440 stars 54 forks source link

Add get_mempolicy, set_mempolicy NUMA syscalls #193

Open wingo opened 8 years ago

wingo commented 8 years ago

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.

justincormack commented 8 years ago

There are a few CI issues.

For automated tests you should be able to at least call get_mempolicy and check it returns something, setting might not be worth testing, although maybe you could set the same policy as returned by get to make sure it round trips?

wingo commented 8 years ago

Tx for the feedback, will poke.

justincormack commented 8 years ago

Would be nice to fix the CI issues...

wingo commented 8 years ago

tx for the ping, will poke

wingo commented 7 years ago

Related: https://github.com/snabbco/snabb/issues/1200

I should get back on this upstreaming horse!

justincormack commented 6 years ago

Yes I think https://github.com/snabbco/snabb/pull/1268/files is needed...