This change adds flexibility to the 'ondemand' service;
it provides the user with the option to configure the cpufreq governor through
/etc/default/cpufrequtils file.
In addition, there is an existing bug when cpufrequtils package is installed;
both 'ondemad' service and cpufrequtils race to set the governor.
In case cpufrequtils is installed and user has chosen a different
governor (by editing the /etc/default/cpufrequtils file) than the one selected
by ondemand service, the ondemand service will overwrite user's settings and
stick to its selection.
With this change the ondemand service will first check if the /etc/default/cpufrequtils
files exist and in case there is a governor defined, the ondemand service will select
the defined governor.
In case there is no such file, ondemand service will behave as it does currently.
The /etc/default/cpufrequtils file is chosen on purpose to provide
compatibility between ondemand service and cpufrequtils package.
I do not agree with the rationale for this change. /etc/default files are not a particularly good interface overall, and the use cases presented are all addressed by disabling the systemd unit completely instead of supporting selection of different governors via this unit.
I should say that respecting the setting for cpufrequtils is sensible, but I think this should be accomplished by making this unit a no-op in the presence of that file, not having ondemand reapply the same policy.
additionally, refusing to make 'ondemand' configurable means anyone wanting to configure their system has to both install cpufrequtils (which is unsupported for UA customers, since it's universe) as well as disabling 'ondemand'.
Seeing the future, it's quite possible that debian (and/or us) simply drop cpufrequtils at some point.
> /etc/default files are not a particularly good interface overall
however, they are widely used for configuration in debian and ubuntu.
> use cases presented are all addressed by disabling the systemd unit
not without *also* installing the cpufrequtils package. Simply disabling ondemand will leave the governor at the kernel-compiled default.
> but I
> think this should be accomplished by making this unit a no-op in the presence
> of that file, not having ondemand reapply the same policy.
option 1) change cpu-setfreq to be a noop when /etc/default/cpufrequtils is detected, AND install cpufrequtils
option 2) change cpu-setfreq to honor /etc/default/cpufrequtils selection, with *or* without cpufrequtils installed
the end result is the same; the only difference is your design requires cpufrequtils to be installed. Is there a reason that design is better than this merge proposal?
and of course:
option 3) change cpu-setfreq to be a noop when /etc/default/cpufrequtils is detected, but without cpufrequtils installed -> this leads to the governor being completely unset, defaulting to the kernel compile default. Probably not exactly expected.
/etc/default/cpufrequtils is a conffile of the cpufrequtils package; I think it is reasonable to respect it if present but that this should be implemented by delegating to the cpufrequtils package in this case.
Is there an actual requirement from a user for setting the governor to a value that is neither the kernel default nor the ondemand behavior?
> additionally, refusing to make 'ondemand' configurable means anyone wanting to configure their system has to both install cpufrequtils (which is unsupported for UA customers, since it's universe) as well as disabling 'ondemand'.
Another option would be to disable ondemand and add a systemd service unit to do what you want instead. For user-known hardware, it'd be pretty much a one-liner, right? Is there any reason this wouldn't be viable?
I had a quick look at what other distributions are currently doing.
From what I can see it seems that Fedora and Arch are currently using the 'cpupower' tool (from linux-tools-common on Ubuntu, kernel-tools on Fedora) and then have a systemd service which relatively simply kicks off a call to 'sudo cpupower -c all frequency-set -g powersave' or similar. That systemd service isn't upstream in the kernel though.
RHEL seems to primarily use tuned to drive the change, which has it's own script to manually twiddle the /sys/devices/system/cpu/*/cpufreq/scaling_governor files.
The kernel default governor is performance.
The 'ondemand' service will choose first interactive, then ondemand and finally
powersave.
(I use 'ondemand' to refer to the systemd service and differentiate it from
ondemand governor.)
Of course depending on the cpufreq driver in use there may be more governors
available such as conservative, userspace and schedutils.
The governor that will be selected depends on :
1) The processor (Intel, ARM etc.)
2) The BIOS settings (OS control, Dynamic etc.)
3) The cpufreq driver used (intel_pstate, pcc-cpufreq, acpi-cpufreq)
4) The available cpufreq governors and the behaviour of 'ondemand' service.
1 and 2 will define the cpufreq driver that will be used (3).
Based on the driver there will be some available governors and 'ondemand' service
will select one of them.
'Ondemand' behaviour or the kernel default suffice when we assume an intel
processor, with intel_pstate driver enabled.
In this case we have available only 2 governors : powersave and performance.
If 'ondemand' is enabled the powersave will be selected, if disabled the kernel
defaults to performance.
(Please note that the powersave and performance governors of intel_pstate are
very different from the acpi-cpufreq ones.)
If we don't run on an intel processor (e.g. ARM) or even if we run on intel
with intel_pstate disabled, then with 'ondemand' enabled the selected governor
will be ondemand and when disabled will be performance.
However, in that case you have more options (powersave, userspace, conservative,
scheduitls).
The current behaviour of 'ondemand' service does not allow you to use any other
governor.
> Is there an actual requirement from a user for setting the governor to a value
that is neither the kernel default nor the ondemand behavior?
I have a laptop with an ARM based CPU.
I want powersave governor because I am low on battery.
Neither enabling nor disabling 'ondemand' service will do the job.
To sum up, currently 'ondemand' is working fine for the average case (intel CPU+intel_pstate driver).
However, this is not the only case.
Modifying 'ondemand' service to make the right decision for every possible
combination of 1,2,3 is way too complicated and maybe impossible given that different
users have different demands for performance and power saving (this is after all the rational behind having all these governors).
This MP does NOT change the default behaviour of 'ondemand'.
It just provides more options for the users.
Plus it resolves the compatibility issues with cpufrequtils.
I can see benefits here and no harm.
And, yes, there are other workarounds (disabling 'ondemand', adding one more service
to do what the user wants etc.).
However I don't see why this is simpler than having 'ondemand' service configurable.
New changelog entries:
* systemd-stable: cherrypick many bugfixes from the v240-stable branch.
Includes many documentation fixes, memory safety (use after free, read
overruns, etc), networkd wireguard fixes, POSIX ACL fix which is preventing adm
group from reading journals (LP: #1824342), journal dropping caches
improvement, fixes regressions in udevadm / machinectl command line parsing.
Files:
- debian/patches/Add-missing-dash-to-all-option-in-the-timedatectl-man-pag.patch
- debian/patches/Add-note-about-transactions-being-genereated-independentl.patch
- debian/patches/Change-job-mode-of-manager-triggered-restarts-to-JOB_REPL.patch
- debian/patches/Fix-omission-in-docs.patch
- debian/patches/Log-the-job-being-merged.patch
- debian/patches/NEWS-document-deprecation-of-PermissionsStartOnly-in-v240.patch
- debian/patches/NEWS-retroactively-describe-.include-deprecation.patch
- debian/patches/Update-systemd-system.conf.xml.patch
- debian/patches/basic-prioq-add-prioq_peek_item.patch
- debian/patches/core-Fix-EOPNOTSUPP-emergency-action-error-string.patch
- debian/patches/core-Fix-return-argument-check-for-parse_emergency_action.patch
- debian/patches/core-mount-do-not-add-Before-local-fs.target-or-remote-fs.patch
- debian/patches/core-mount-move-static-function-earlier-in-file.patch
- debian/patches/curl-util-fix-use-after-free.patch
- debian/patches/ethtool-Make-sure-advertise-is-actually-set-when-autonego.patch
- debian/patches/journal-avoid-buffer-overread-when-locale-name-is-too-lon.patch
- debian/patches/journal-limit-the-number-of-entries-in-the-cache-based-on.patch
- debian/patches/journald-periodically-drop-cache-for-all-dead-PIDs.patch
- debian/patches/machinectl-fix-argument-index-in-error-log.patch
- debian/patches/man-Fix-a-typo-in-systemd.exec.xml.patch
- debian/patches/man-fix-reference.patch
- debian/patches/man-fix-volume-num-of-journalctl.patch
- debian/patches/man-update-DefaultDependency-in-systemd.mount-5.patch
- debian/patches/netlink-set-maximum-size-of-WGDEVICE_A_IFNAME.patch
- debian/patches/network-make-Link-and-NetDev-always-have-the-valid-poiter.patch
- debian/patches/network-unset-Network-manager-when-loading-.network-file-.patch
- debian/patches/network-wireguard-rename-and-split-set_wireguard_interfac.patch
- debian/patches/networkd-wait-for-kernel-to-reply-ipv6-peer-address.patch
- debian/patches/nspawn-ignore-SIGPIPE-for-nspawn-itself.patch
- debian/patches/pager-improve-english-a-bit.patch
- debian/patches/pid1-fix-cleanup-of-stale-implicit-deps-based-on-proc-sel.patch
- debian/patches/procfs-util-expose-functionality-to-query-total-memory.patch
- debian/patches/pull-fix-invalid-error-check.patch
- debian/patches/shared-Revert-commit-49fe5c099-in-parts-for-function-pars.patch
- debian/patches/shared-dissect-image-make-sure-that-we-don-t-truncate-dev.patch
- debian/patches/test-execute-unset-HOME-before-testing.patch
- debian/patches/udev-do-logging-before-setting-variables-to-NULL.patch
- debian/patches/udev-val-may-be-NULL-use-strempty.patch
- debian/patches/udevadm-info-a-should-enumerate-sysfs-attributes-not-envs.patch
- debian/patches/udevd-use-worker_free-on-failure-in-worker_new.patch
- debian/patches/units-make-sure-initrd-cleanup.service-terminates-before-.patch
- debian/patches/wait-online-do-not-fail-if-we-receive-invalid-messages.patch https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=2b3db732ba7e5418d45ca42884e8d075189f2724
* Only test that gdm3 comes up on amd64. Stalls on other arches.
File: debian/tests/control https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=97cb13685dfb353045c449ec5d6d1df60f661079
* tests/storage: make the test more resilient.
Skip if the scsi_debug module is not available (like on custom kernels). Do not
fail the tests if removing the module fail, at the end of the test run.
File: debian/tests/storage https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=c08dcb1ffe372acd3a21496758a1984ff78dcdd4
New changelog entries:
* virt: detect WSL environment as a container (LP: #1816753)
* debian/control: Update Vcs-{Browser|Git} to Ubuntu's packaging repository
* debian/gbp.conf: Set tag format to ubuntu/*
9b1d7bb...
by
Ioanna Alifieraki <email address hidden>
Import patches-unapplied version 240-6ubuntu2 to ubuntu/disco-proposed
New changelog entries:
* High urgency as this fixes a vulnerability.
[ Felipe Sateler ]
* Reenable pristine-tar in gbp.conf.
The pristine-tar bug has been fixed, so we can use it again.
This reverts commit 9fcfbbf6fea15eacfa3fad74240431c5f2c3300e.
* d/watch: add version mangle to transform -rc to ~rc.
Upstream has started releasing rcs, so let's account for that
* Fix comment about why we disable hwclock.service.
Systemd nowadays doesn't do it itself because the kernel does it on its
own when necessary, and when not, it is not safe to save the hwclock (eg,
there is no certainty the system clock
is correct)
* udev: Backport upstream preventing mass killings when not running under
systemd (Closes: #918764)
[ Dimitri John Ledkov ]
* debian/tests/storage: improve cleanups.
On fast ppc64el machines, cryptsetup start job may not complete by the
time tearDown is executed. In that case stop, causes to simply cancel the
start job without actually cleaning up the dmsetup node. This leads to
failing subsequent test as it no longer starts with a clean device. Thus
ensure the systemd-cryptsetup unit is started, before stopping it.
Also rmmod scsi_debug module at the end, to allow re-running the test in a
loop.
* debian/tests/upstream: Mark TEST-13-NSPAWN-SMOKE as flakey.
* debian/tests/control: add socat to upstream tests for pull #11591
* Blacklist TEST-10-ISSUE-2467 #11706
* debian/tests/storage: fix for LUKS2 and avoid interactive password
prompts.
[ Martin Pitt ]
* udevadm: Fix segfault with subsystem-match containing '/'
(Closes: #919206)
* sd-bus: if we receive an invalid dbus message, ignore and proceed
* sd-bus: enforce a size limit on D-Bus object paths.
This avoids accessing/modifying memory outside of the allocated stack
region by sending specially crafted D-Bus messages with very large object
paths.
Vulnerability discovered by Chris Coulson <email address hidden>,
patch provided by Riccardo Schirone <email address hidden>.
(CVE-2019-6454)
New changelog entries:
[ Benjamin Drung ]
* Fix shellcheck issues in initramfs-tools scripts
[ Michael Biebl ]
* Import patches from v240-stable branch (up to f02b5472c6)
- Fixes a problem in logind closing the controlling terminal when using
startx. (Closes: #918927)
- Fixes various journald vulnerabilities via attacker controlled alloca.
(CVE-2018-16864, CVE-2018-16865, Closes: #918841, Closes: #918848)
* sd-device-monitor: Fix ordering of setting buffer size.
Fixes an issue with uevents not being processed properly during coldplug
stage and some kernel modules not being loaded via "udevadm trigger".
(Closes: #917607)
* meson: Stop setting -fPIE globally.
Setting -fPIE globally can lead to miscompilations on certain
architectures. Instead use the b_pie=true build option, which was
introduced in meson 0.49. Bump the Build-Depends accordingly.
(Closes: #909396)
New changelog entries:
* udev.init: Trigger add events for subsystems.
Update the SysV init script and mimic the behaviour of the initramfs and
systemd-udev-trigger.service which first trigger subsystems and then
devices during the coldplug stage.
* udevadm: Refuse to run trigger, control, settle and monitor commands in
chroot (Closes: #917633)
* network: Set link state configuring before setting addresses.
Fixes a crash in systemd-networkd caused by an assertion failure.
(Closes: #918658)
* libudev-util: Make util_replace_whitespace() read only len characters.
Fixes a regression where /dev/disk/by-id/ names had additional
underscores.
* man: Update color of journal logs in DEBUG level (Closes: #917948)
* Remove old state directory of systemd-timesyncd on upgrades.
Otherwise timesyncd will fail to update the clock file if it was created
as /var/lib/private/systemd/timesync/clock.
This was the case when the service was using DynamicUser=yes which it no
longer does in v240. (Closes: #918190)
I do not agree with the rationale for this change. /etc/default files are not a particularly good interface overall, and the use cases presented are all addressed by disabling the systemd unit completely instead of supporting selection of different governors via this unit.