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

FIXME fix suggestions and question on fork semantics when tasks are moved #46

Open
matu3ba opened this issue Jul 16, 2023 · 0 comments
Open

Comments

@matu3ba
Copy link

matu3ba commented Jul 16, 2023

FIXME fix suggestions

  1. Problem # FIXME: popen is slow...
    Solution: popen can be used with an array, which should not spawn a shell: https://docs.python.org/3.5/library/subprocess.html#replacing-functions-from-the-popen2-module

  2. Problem # FIXME: very fragile
    Solution: Use counter index + argument class and let python handle the range checks. That way you can also offer nice stuff like saving cli args to file and loading from file + sanity check forwarded args etc.

I am not familiar with cpuset format etc yet, so I cant give advice on the other things.

  1. More general improvements: Use, whenever possible, f-strings to improve performance and code clarity. For binary data unfortunately it is not possible, for utf8 encoded one it is.

Question on fork semantics when tasks are moved

https://man7.org/linux/man-pages/man7/cpuset.7.html does not mention that any race condition can occur during the move, but this website with a more in-depth tutorial claims this can occur

Note. There is a minor chance that a task forks during move and its child remains in the root cpuset. 
    1. Do user space processes also have these problems? If yes, could 1.1 a low level api use strace to repeat and 1.2 is there a Kernel callback/event to listen for, if the cpuset has been successfully applied to a process after some write?
    1. Does the Kernel provide a subsystem to group threads (ie names) and is there a user-space available API for aforementioned points 1.1 and 1.2 ?
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

No branches or pull requests

1 participant