-
Notifications
You must be signed in to change notification settings - Fork 71
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
Added CPU isolation #378
Added CPU isolation #378
Conversation
Both CPU pinning and CPU isolation is possible thru the GUI
Note: this solution isn't complete. Removing a 2nd card doesn't work
Without adding this PR, if you isolate a core, will the docker pinning then disallow the isolated cores? Pinning a container to one or more isolated cores will effectively only allow execution on the first selected core. |
The current implementation doesn't have restrictions. |
Not a conflict per se. What isolating CPUs actually does is stop the context switcher from utilizing those cores. Doesn't actually prevent any executable from manually utilizing them via the appropriate commands (ie: pinning a container to an isolated core) But, since the context switcher won't operate on those isolated cores, Linux won't switch the threads back and forth between isolated cores automatically. Net result is that if a container is pinned to multiple isolated cores, it will only actually execute on the first core. Hence why I would like to see that if the user is isolating cores then the cores become unavailable to pin to a container. Would just solve some problems on the forum by removing the option to pin a container to an isolated core. (Plus it makes no sense anyways, because even without knowing the fundamental goings on beneath the surface, by isolating cores you are telling the OS to not use the cores for anything, but to reserve them for VMs) Of course the complication arises if a user has already pinned cores, and then chooses to isolate them. But, that would be a whole different story catching that situation at time of docker run and adjusting the pinning accordingly. Probably something more suited for FCP to catch. Side related thought: is there a variable (or can there be) that shows the mode unRaid booted in (GUI / normal) |
The cephalopod is correct: pinning multiple isolated CPU's to a container only lets container utilize lowest numbered CPU. This is a kernel "issue" though kernel guys would probably argue it's a kernel "feature". I think the best approach is to prohibit users from selecting isolated cores for container cpu-pinning. If user really wants to dedicate a single core to a container (maybe they turned off hyperthreading or CPU does not have hyperthreading), then they can turn off isolcpus, pin their cores the way they want, then turn isolcpus on the way they want. FCP might gripe but they'll know why it's griping. re: boot mode: you could check for existence of /root/.mozilla/ or /root/.Xauthority/ which are only present in GUI boot mode. Edit: could also grep for '/bzroot-gui' on /proc/cmdline |
Adding restrictions may lead to confusion? The help text can point people in the right direction. So maybe some of the explanation given here should go into the help text? |
Yes that's fine. |
Both CPU pinning and CPU isolation is possible thru the GUI