Skip to content

Implement thread affinity#114

Open
gaomy3832 wants to merge 13 commits intos5z:masterfrom
gaomy3832:affinity
Open

Implement thread affinity#114
gaomy3832 wants to merge 13 commits intos5z:masterfrom
gaomy3832:affinity

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