Skip to content
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

Numa upstream #1038

Merged
merged 4 commits into from Nov 7, 2016
Merged

Numa upstream #1038

merged 4 commits into from Nov 7, 2016

Conversation

wingo
Copy link
Contributor

@wingo wingo commented Oct 17, 2016

This PR is a distilled port of Igalia#341 to Snabb master, adding a couple of interfaces to ljsyscall, pulling in a getcpu() bugfix from @kbara, and then adding a Snabb module that lets you do numa.bind_to_cpu(CPU) in Snabb. That will bind the current thread to that CPU, bind the memory for that thread to that CPU's NUMA node, and migrate all memory to that NUMA node. It's ideal for hooking up to a --cpu command-line argument, with no taskset / numactl shenanigans, and with the additional benefit of migrating pages. (That's what we do in the lwaftr; this commit is from Igalia/lwaftr and something we need to land upstream before merging upstream.)

The ljsyscall change is going upstream here: justincormack/ljsyscall#193. Embarassingly I can't yet run docker on this guixsd machine so I haven't been able to add/fix the tests upstream yet :P However this patch does run in production, so there's that.

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.
Patch by Katerina Barone-Adesi <kbarone@igalia.com>, committed upstream
via justincormack/ljsyscall#195.
* lib/ljsyscall/syscall/linux/c.lua:
* lib/ljsyscall/syscall/linux/syscalls.lua: Add support for the
  migrate_pages Linux syscall.
@kbara
Copy link
Contributor

kbara commented Oct 19, 2016

LGTM. I'm assuming this should also go into wingo-next; if you'd rather it go into kbara-next, give me a shout.

@wingo
Copy link
Contributor Author

wingo commented Oct 19, 2016

Thanks @kbara, will merge to wingo-next. Just the NFV thing left to do before merging.

wingo added a commit that referenced this pull request Oct 19, 2016
@eugeneia
Copy link
Member

LGTM! lib.numa should probably have a README though.

@wingo
Copy link
Contributor Author

wingo commented Oct 20, 2016

Tx for review, already in next. Readme on the way in #1048.

@wingo wingo added the merged label Oct 21, 2016
@eugeneia eugeneia merged commit 3b5fe60 into snabbco:master Nov 7, 2016
@wingo wingo deleted the numa-upstream branch June 5, 2017 13:00
lukego pushed a commit to lukego/snabb that referenced this pull request Mar 22, 2018
Fix out-of-bounds write in ctable test suite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants