http://bugzilla.opensuse.org/show_bug.cgi?id=1074067 Bug ID: 1074067 Summary: Linux does not obey nice level of process running under systemd Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: SUSE Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: andreas_nordal_4@hotmail.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Process niceness is obeyed when run from a terminal, but not when running as a systemd service. I would not be surprised if there was some cgroup trickery option I could/should have used (that's above me), but I'm flabbergasted that simple process niceness doesn't work by default, and that what you get instead (probably because of cgroups) is effectively a bit opposite. This systemd service does not do what its description says, and I'm unable to fix it: ---8<--- [Unit] Description=Dummy CPU load for 4 threads, as non-intrusive as possible [Service] User=boinc Nice=19 ExecStart=/bin/sh -c 'n="$(python3 -c "print((1<<(1<<9)) + 1)")"; factor "$n" | factor "$n" | factor "$n" | factor "$n"' # Doesn't help either #CPUSchedulingPolicy=idle #CPUWeight=1 #ControlGroup=cpu:/background --->8--- Based on https://anonscm.debian.org/cgit/pkg-boinc/boinc.git/tree/debian/boinc-client... Reproduction steps: 1. Adjust the above systemd service for the number of CPU threads and run it. 2. Watch htop: Blue CPU load is "nice"; green is normal. 3. See if niceness is obeyed: Run the same command (as the value of ExecStart=) in another terminal. Expected behavior: Niceness is obeyed: Practically no blue CPU load in htop whenever there are enough more important tasks to run. Actual behavior: Half of my 4 CPU cores seem devoted to the "nice" CPU load, regardless of the amount of more important tasks. Version info: systemd 234-9.1 linux 4.14.2-1-default -- You are receiving this mail because: You are on the CC list for the bug.