禁用 Systemd 的并行化以进行 CPU 超频

禁用 Systemd 的并行化以进行 CPU 超频

我正在尝试找到一种方法来改变 systemd 初始化过程以禁用进程的并行化,从而实现 CPU 超频,而不会在启动时导致系统崩溃。

我的系统显然是一个游戏系统,在 BIOS 中具有基本的内置超频控制,我研究了调整 Linux 系统(目前是 debian)的所有方法,以获得一般使用和游戏的最大性能。

目前,这是我发现的主要瓶颈,而许多提高性能的改变都非常简单/易于实施。改变 systemd 的功能显然更复杂。

无论如何,我看不到在不手动编辑 systemd 单元配置文件的情况下简单地实现此目标的方法,这与为此特定实用程序内置的简单选项或开关相比有点令人生畏。

我想不出这个问题的另一种解决方案,但很明显,启动进程的并行化创造了导致我的系统在BIOS中打开CPU超频时崩溃的条件。

我尝试了其他发行版的替代初始化系统,如 openrc 和 runit,这可能是一个解决方案,但理想情况下应该有一个许多应用程序所依赖的 systemd 解决方案。

从 debian 手册.. https://www.debian.org/doc/manuals/debian-reference/ch03.en.html

3.2. Systemd init

This section describes how system is started by the systemd(1) program with PID=1 (i.e., init process).

The systemd init process spawns processes in parallel based on the unit configuration files (see systemd.unit(5)) which are written in declarative style instead of SysV-like procedural style.

The spawned processes are placed in individual Linux control groups named after the unit which they belong to in the private systemd hierarchy (see cgroups and Section 4.7.4, “Linux security features”).

The unit configuration files are loaded from a set of paths (see systemd-system.conf(5)) as follows:

    "/lib/systemd/system": OS default configuration files

    "/etc/systemd/system": system administrator configuration files which override the OS default configuration files

    "/run/systemd/system": run-time generated configuration files which override the installed configuration files

Their inter-dependencies are specified by the directives "Wants=", "Requires=", "Before=", "After=", … (see "MAPPING OF UNIT PROPERTIES TO THEIR INVERSES" in systemd.unit(5)). The resource controls are also defined (see systemd.resource-control(5)).

The suffix of the unit configuration file encodes their types as:

    *.service describes the process controlled and supervised by systemd. See systemd.service(5).

    *.device describes the device exposed in the sysfs(5) as udev(7) device tree. See systemd.device(5).

    *.mount describes the file system mount point controlled and supervised by systemd. See systemd.mount(5).

    *.automount describes the file system auto mount point controlled and supervised by systemd. See systemd.automount(5).

    *.swap describes the swap device or file controlled and supervised by systemd. See systemd.swap(5).

    *.path describes the path monitored by systemd for path-based activation. See systemd.path(5).

    *.socket describes the socket controlled and supervised by systemd for socket-based activation. See systemd.socket(5).

    *.timer describes the timer controlled and supervised by systemd for timer-based activation. See systemd.timer(5).

    *.slice manages resources with the cgroups(7). See systemd.slice(5).

    *.scope is created programmatically using the bus interfaces of systemd to manages a set of system processes. See systemd.scope(5).

    *.target groups other unit configuration files to create the synchronization point during start-up. See systemd.target(5).

Upon system start up (i.e., init), the systemd process tries to start the "/lib/systemd/system/default.target (normally symlinked to "graphical.target"). First, some special target units (see systemd.special(7)) such as "local-fs.target", "swap.target" and "cryptsetup.target" are pulled in to mount the filesystems. Then, other target units are also pulled in by the target unit dependencies. For details, read bootup(7).

systemd offers backward compatibility features. SysV-style boot scripts in "/etc/init.d/rc[0123456S].d/[KS]name" are still parsed and telinit(8) is translated into systemd unit activation requests.

和 /etc/systemd/system.conf

#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the system.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/system.conf' to display the full conf>
#
# See systemd-system.conf(5) for details.

[Manager]
#LogLevel=info
#LogTarget=journal-or-kmsg
#LogColor=yes
#LogLocation=no
#LogTime=no
#DumpCore=yes
#ShowStatus=yes
#CrashChangeVT=no
#CrashShell=no
#CrashReboot=no
#CtrlAltDelBurstAction=reboot-force
#CPUAffinity=
#NUMAPolicy=default
#NUMAMask=
#RuntimeWatchdogSec=off
#RuntimeWatchdogPreSec=off
#RuntimeWatchdogPreGovernor=
#RebootWatchdogSec=10min
#KExecWatchdogSec=off
#WatchdogDevice=
#CapabilityBoundingSet=
#NoNewPrivileges=no
#SystemCallArchitectures=
#TimerSlackNSec=
#StatusUnitFormat=description
#DefaultTimerAccuracySec=1min
#DefaultStandardOutput=journal
#DefaultStandardError=inherit
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
#DefaultTimeoutAbortSec=
#DefaultDeviceTimeoutSec=90s
#DefaultRestartSec=100ms
#DefaultStartLimitIntervalSec=10s
#DefaultStartLimitBurst=5
#DefaultEnvironment=
#DefaultCPUAccounting=no
#DefaultIOAccounting=no
#DefaultIPAccounting=no
#DefaultMemoryAccounting=yes
#DefaultTasksAccounting=yes
#DefaultTasksMax=15%
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
#DefaultLimitSTACK=
#DefaultLimitCORE=
#DefaultLimitRSS=
#DefaultLimitNOFILE=1024:524288
#DefaultLimitAS=
#DefaultLimitNPROC=
#DefaultLimitMEMLOCK=8M
#DefaultLimitLOCKS=
#DefaultLimitSIGPENDING=
#DefaultLimitMSGQUEUE=
#DefaultLimitNICE=
#DefaultLimitRTPRIO=
#DefaultLimitRTTIME=
#DefaultOOMPolicy=stop
#DefaultSmackProcessLabel=

systemd 的手册页指出...

6. Automount units provide automount capabilities, for on-demand
   mounting of file systems as well as parallelized boot-up. See
   systemd.automount(5).

答案1

如果机器并行运行多个任务不稳定,那么它将无法运行也并行运行多个任务的现代游戏。

例如,现在通常将图形处理划分为对几何数据进行操作的更紧密的循环(因此每帧都会更新位置)和更新照明的较慢的循环(没有人注意到灯光是否有不同的闪烁),然后并行运行两者。

超频时,您需要选择一种配置,即使组件升温导致容差缩小,也能在数小时内保持满负载稳定。

答案2

因此,在 xfce 面板上的操作系统内使用一个默认的小程序来控制它甚至都没有关系。现在我速度极快

相关内容