-
Notifications
You must be signed in to change notification settings - Fork 28
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
cpuset not working with present arch linux (maybe cgroupv2?) #40
Comments
Hello.
? Also, what systemd version is this? (I'm just checking, but I'd generally not expect cpuset working with v2 cpuset controller.) |
Results on the metal Results in a VM systemd is 248-5 on both |
Thanks. So the cpuset controller is bound to the v2 hierarchy and it also shows that systemd runs in the unified mode (that was perhaps the critical change between updates). I'm afraid the cset utility can't serve you in such a setup. (As a workaround, you may switch via kernel cmdline back to the hybrid setup |
@Werkov Do you have any advice on how to shield CPU cores now, with the new unified cgroup hierarchy? Does systemd have any functionality for this? I am unable to find any information about this. |
@Hubro With the recent systemd version you should be able to specify |
@Werkov Is it possible to set EDIT: I figured out how I set sudo systemctl set-property --runtime user.slice AllowedCPUs=0-3
sudo systemctl set-property --runtime system.slice AllowedCPUs=0-3 This didn't do anything for me, but I assume that's because I disabled unified cgroup hierarchy. I'll test this out later with unified hierarchy enabled. I still have no idea how to keep kernel threads off my virtualization cores though. |
Setting the cgroup attributes should work at runtime exactly as you did (alternatively you can edit slice unit or drop-in files and call If you need "silence" on the cpu, then see isolcpus kernel cmdline. I'm just curious, why you need to keep kernel threads off your selected cores (is that due to RT constraints)? |
@Werkov My use case is a high performance virtual machine doing realtime tasks, so I'm doing everything I can to reduce latency and stutters on those cores. I'm not entirely sure how isolcpus works. Will this keep kernel threads off those cores, or will it keep everything off them? I want to be able to do compilation and encoding tasks using all my host cores when my VMs are not running, so any kernel cmdline parameters that prevent that is not an option for me. I just noticed the docs you linked says that isolcpus is deprecated:
Does that mean that cpusets can do all the things that isolcpus can do? 🤔 |
Not exactly, isolcpus is often used to disable scheduler load balancing on a CPU and that's the only In fact isolcpus does much more as it also isolates from unbound kernel threads, workqueues, timers, etc... I understand you can't afford to use boot parameters but it's worth being aware of "nohz_full=". |
Thanks, @fweisbec, for the comment and recommendation about Ad cpuset v2 cgroup controller in general, I'll dump my current thoughts here. It's not going to be a neatly formulated message but I'll be grateful for alternate views and opinions.
At this point, I'd like to know your opinion(s) about whether it is safe to manipulate systems cgroup settings without the daemon's consent. If you have any further comments, feel free to drop them here as well. Thanks! |
Fortunately, this is irrelevant for cgroup hierarchies that are not managed by systemd. Practically, the cpuset utility could be used safely with systemd prior v244 (which introduced support for cpuset in systemd (edit: therefore cpuset hierarchy was unmanaged by systemd in the older versions)).
Nowadays with v2, it is safe when the operations are carried out in a dedicated subtree only. Full description is in the document about cgroup delegation with systemd. |
Has anyone managed to set isolcpus on Arch using EFISTUB (efibootmgr) by any chance? Edit: possibly related: https://lore.kernel.org/lkml/20200414215715.GB182757@xz-x1/T/#u |
No idea but you can still hardcode kernel boot option with CONFIG_CMDLINE_BOOL + CONFIG_CMDLINE |
My issue was with the BIOS. It somehow deduplicates boot entries having the same image, but different parameters. In my case I can get it to work by entering bios and modifying boot priority order (even if efibootmgr correctly reports the order). |
Just chiming in here, I'm looking to use Is there currently any plan to support the unified hierarchy? I ask because, while the systemd unit option might be useful in some cases, in my case I'm using |
This is required on Debian 11 to use the cset tool, since the newer systemd implementation of a unified cgroup hierarchy is not compatible with the cset tool. Ref for future use: SUSE/cpuset#40
This is required on Debian 11 to use the cset tool, since the newer systemd implementation of a unified cgroup hierarchy is not compatible with the cset tool. Ref for future use: SUSE/cpuset#40
Actually, you should just be able to leverage the hierarchy and apply cpuset systemd settings on the top-level units only ( |
Interesting, that would definitely suit my needs, I'll give it a shot. I hadn't considered setting it at the slice level! |
just some suggestions because cset is no longer usable for many: SUSE/cpuset#40 i tried to replicate what `cset` does in your original script with the suggestions from the linked issue. i am unsure if setting the `/sys/bus/workqueue/devices/writeback/cpumask` is superflous if `nohz_full` is configured
just some suggestions because cset is no longer usable for many: SUSE/cpuset#40 i tried to replicate what `cset` does in your original script with the suggestions from the linked issue. i am unsure if setting the `/sys/bus/workqueue/devices/writeback/cpumask` is superflous if `nohz_full` is configured
just some suggestions because cset is no longer usable for many: SUSE/cpuset#40 i tried to replicate what `cset` does in your original script with the suggestions from the linked issue. i am unsure if setting the `/sys/bus/workqueue/devices/writeback/cpumask` is superflous if `nohz_full` is configured
This is required on Debian 11 to use the cset tool, since the newer systemd implementation of a unified cgroup hierarchy is not compatible with the cset tool. Ref for future use: SUSE/cpuset#40
Problem seems to afflict arch linux on two different kernels, I think it has to do with them using control group v2 and cpuset expecting v1 perhaps? Arch upgraded in a recent update.
symptom looks like this;
root@monolith:~# cset shield --cpu=0-7
mount: /cpusets: none already mounted on /sys/fs/bpf.
cset: **> mount of cpuset filesystem failed, do you have permission?
Two kernels confirmed affected;
Linux monolith 5.4.85-1-vfio-lts #1 SMP Wed, 23 Dec 2020 06:46:51 +0000 x86_64 GNU/Linux
Linux magister 5.9.11-xanmod1-1 #1 SMP PREEMPT Tue, 01 Dec 2020 12:38:55 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: