-
Notifications
You must be signed in to change notification settings - Fork 38
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
Improve thread scheduling for lockhammer #18
Improve thread scheduling for lockhammer #18
Conversation
Add an option which controls the order in which logical core numbers are populated. Lockhammer currently specializes the order in which it schedules hardware threads for systems where 2 threads share cpu resources (same physical core, shared cache, etc). Since several configurations exist from unique resources per thread to 4 or more threads per core add the option to arbitrarily select the interleave between logical core numbers which share physical resources. Fixes ARM-software#17 Change-Id: I90a04082750f7ebdc5121294e2a214195896c373 Signed-off-by: Lucas Crowthers <lucasc.qdt@qualcommdatacenter.com>
Can one of the admins verify this patch? |
Let's rethink this one since it didn't fix the issue Cavium raised. The interleave option is still useful for other reasons but I'd rather not change the affinity setting unless we have a good reason to do so. |
aee8ca9
to
12b45f8
Compare
I have updated this PR to only include the interleave command line option. We can address further thread scheduling issues in subsequent PRs after further experimentation. |
@@ -265,7 +278,7 @@ void* hmr(void *ptr) | |||
} | |||
else { | |||
/* Calculate affinity mask for my core and set affinity */ | |||
CPU_SET(((mycore >> 1)) + ((ncores >> 1) * (mycore & 1)), &affin_mask); | |||
CPU_SET(((mycore * ncores / ileave) % ncores + (mycore / ileave)), &affin_mask); |
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.
Hi Lucas,
Can you add a comment here about the interleaving assumption is 0 - (numcores / numthreads) is thread 0 on each physical core, (numcores / numthreads) - 2 * (numcores / numthreads) is thread 1 on each core etc?
Add some documentation to the source code which describes the relationship between threads, physical cores, and logical core numberings and how the interleave option can be used to select which will be populated first with increasing core counts. Change-Id: I5a5eee67a4e3f1579690cd76a93deccbccaf4cfd Signed-off-by: Lucas Crowthers <lucasc.qdt@qualcommdatacenter.com>
817aba4
to
abc16f7
Compare
Add a core interleave argument to lockhammer which determines the order in which logical core numbers are populated.
Fixes #17