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

Implement thread affinity #114

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Implement thread affinity #114

wants to merge 13 commits into from

Conversation

gaomy3832
Copy link
Contributor

Implement the visualization of sched_set/getaffinity syscalls. As requested in #81.

Try to be compatible with the current process mask and per-process CPU enumeration. The cpu set specified in sched_setaffinity must be within the process mask in cfg file.

Since pthread_set/getaffinity_np are implemented on top of sched_set/getaffinity, they are also supported.

Also included a small test program (as a demo).

The cpu set specified by the app must be within the range of the process
mask in the cfg file. Also per-process cpu enumeration is supported.
@gaomy3832
Copy link
Contributor Author

Please hold on reviewing or merging this pull request. I noticed that the current affinity only support pinning the call thread itself (i.e., 0 for the pid argument). I would like to extend to cover pinning other threads too.

@gaomy3832
Copy link
Contributor Author

I reused the Linux OS thread id stored in scheduler to figure out the corresponding thread id. Now please go on reviewing the code.

@gaomy3832 gaomy3832 mentioned this pull request Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant