Uh oh!
There was an error while loading. Please reload this page.
NUMA bindings support for Shm Segments - #161
Conversation
haowu14
left a comment
There was a problem hiding this comment.
Thank you for making this PR. It looks good overall. Mostly just coding style nits.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
79bbf1a to
21b8cbbCompareUh oh!
There was an error while loading. Please reload this page.
| } | ||
| static void forcePageAllocation(void* addr, size_t size, size_t pageSize) { | ||
| for(volatile char* curAddr = (char*)addr; curAddr < (char*)addr+size; curAddr += pageSize) { |
There was a problem hiding this comment.
please use reinterpret_cast instead of c-style casting.
21b8cbb to
682cc63Compare682cc63 to
9a6bbb1Compare| return; | ||
| } | ||
| switch (errno) { |
There was a problem hiding this comment.
Do we need a wrapper for handling different error case here just to compile the error message? What would the strerror() have to say here?
Also, it seems that we don't use the any other flag except MPOL_BIND.
There was a problem hiding this comment.
strerror() is context independent and too abstract.
Regarding flag variable. Today it is 0 (MPOL_BIND is a mode parameter) when we call mbindImpl(), but it is passed as a parameter to the mbindImpl() function. What if in the future we will set flag with some values?
If we assume that flag is always 0, like in current implementation, the switch block could be simplified to the following:
switch (errno) {
case EFAULT:
util::throwSystemError(errno);
break;
case EINVAL:
util::throwSystemError(errno, "Invalid parameters when bind segment to NUMA node(s)");
break;
case ENOMEM:
util::throwSystemError(errno, "Could not bind memory. Insufficient kernel memory was available");
break;
default:
XDCHECK(false);
util::throwSystemError(errno, "Invalid errno");
}
Should we simply the implementation for now?
There was a problem hiding this comment.
This is just an error path, which is unlikely or unexpected to be hit. Would just printing errno along with strerror() just work for debugging?
There was a problem hiding this comment.
Ok, I agree. I have replaced this switch block with strerror()
| if(opts_.memBindNumaNodes.empty()) return; | ||
| struct bitmask *oldNodeMask = numa_allocate_nodemask(); | ||
| auto guard = folly::makeGuard([&] { numa_bitmask_free(oldNodeMask); }); |
There was a problem hiding this comment.
You've already added NumaBitMask wrapping the struct bitmask. Why not use it instead of having this destructor? Also, I think you can override the cast operator to struct bitmask and pass the NumaBitMask instead of struct bitmask
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
9a6bbb1 to
edd034dCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| return; | ||
| } | ||
| switch (errno) { |
There was a problem hiding this comment.
This is just an error path, which is unlikely or unexpected to be hit. Would just printing errno along with strerror() just work for debugging?
jaesoo-fb
commented
Nov 18, 2022
nit. I think it will be fixed automatically when we pull those, but could you remove the trailing whitespaces and tabs? |
edd034d to
24996c4CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
24996c4 to
1fbc002Compare
jaesoo-fb
left a comment
There was a problem hiding this comment.
LGTM. Could you resolve Hao's comments?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1fbc002 to
bda5e07Comparefacebook-github-bot
commented
Dec 2, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
facebook-github-bot
commented
Dec 14, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
facebook-github-bot
commented
Dec 14, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
2 similar comments
facebook-github-bot
commented
Dec 14, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
facebook-github-bot
commented
Dec 14, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
jaesoo-fb
commented
Dec 14, 2022
@vinser52 Hi. There are some merge conflicts encountered while importing this ( |
jaesoo-fb
left a comment
There was a problem hiding this comment.
While you are doing the rebase, could you add space after for and if?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bda5e07 to
3b3a733Comparefacebook-github-bot
commented
Dec 15, 2022
@vinser52 has updated the pull request. You must reimport the pull request before landing. |
vinser52
commented
Dec 15, 2022
Done |
facebook-github-bot
commented
Dec 15, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
3b3a733 to
e041015Comparefacebook-github-bot
commented
Dec 16, 2022
@vinser52 has updated the pull request. You must reimport the pull request before landing. |
vinser52
commented
Dec 16, 2022
Hi @jaesoo-fb, I just fixed one minor issue after the merge. Please re-import this PR again. Sorry for the inconvenience. |
facebook-github-bot
commented
Dec 16, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
jaesoo-fb
commented
Dec 16, 2022
Somehow, I cannot clearly see what has been changed, and also I cannot checkout the intermediate version Can you confirm? Also, can you remove this white space? |
e041015 to
b5422cfComparefacebook-github-bot
commented
Dec 16, 2022
@vinser52 has updated the pull request. You must reimport the pull request before landing. |
facebook-github-bot
commented
Dec 16, 2022
@jaesoo-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
vinser52
commented
Dec 16, 2022
Yeah, I confirm. After rebase Trailing whitespace in |
jaesoo-fb
commented
Dec 16, 2022
No, I don't think squashing the change is the problem; I expected the git repository should have the old commit accessible until being GCed. Anyway, no worries for this. |
facebook-github-bot
commented
Dec 27, 2022
@jaesoo-fb merged this pull request in 26e02bf. |
Summary: Fix OSS builds by adding numa deps to build files. Currently some fail on missing `numa.h`. Context: #161 added the dependencies to the centOS, debian, and ubuntu18 build files. The PR was opened in Sep 2022 but only landed in Dec 2022, and so probably missed out on the fedora, rocky and arch build files which were added in-between those dates. Having had those build actions run on PRs would have caught this (currently, they are only scheduled.) Pull Request resolved: #197 Test Plan: Github Actions builds (ideally, #198 would be landed first.) I've checked that those packages exist for the respective repositories but didn't run them myself. Reviewed By: jaesoo-fb Differential Revision: D43587970 Pulled By: jiayuebao fbshipit-source-id: 8c59e48528042350e576a45ffc3bf2520699f5a9
This set of changes allows binding particular memory segments to the specified NUMA node(s).