CPUPLUGD.CONF(5)
๐ธ NAME ๐ธ
okay so bestie, meet cpuplugd.conf(5) โ it's from the File Formats Manual and it's literally the configuration file for the Linux on System z CPU and memory hotplug daemon. ๐
๐ DESCRIPTION ๐
The cpuplugd.conf configuration file contains the configuration information for the Linux for System z CPU and memory hotplug daemon.
Use this file to specify rules for enabling or disabling CPUs and for adding or removing memory. โจ
๐ฅ๏ธ CPU hotplug ๐ฅ๏ธ
CPUs can be enabled and disabled through a sysfs interface. The status file for a CPU, here CPU number 16 (counting starts at 0), is /sys/devices/system/cpu/cpu15/online.
Writing a 0 to this file disables the CPU. Writing a 1 enables the CPU. ๐
๐พ Memory hotplug ๐พ
The rules that add or remove memory use the cooperative memory management (CMM) feature.
CMM is a mechanism to reduce the memory available to Linux instances that run as guests of z/VM. CMM allocates pages to a dynamic page pool not available to Linux. A diagnose code indicates to z/VM that the pages in the page pool are out of use. z/VM can then immediately reuse these pages for other guests. ๐ฆ
๐ Layout of the configuration file ๐
The configuration file contains variables specifying static numbers or expressions. They are of the format <variable>="<value>" and they need to be specified within one line. Expressions can be specified to calculate algebraic values or to define boolean rules, which determine when a hotplug/hotunplug action should be taken. The maximum valid line length is 2048 characters.
There are case-insensitive pre-defined and case-sensitive user-defined variables. The configuration file must include specifications for all pre-defined variables. If a variable is not set, the hotplug function it applies to, CPU or memory, is disabled. The only exception to this rule is CMM_DEC, which defaults to the setting for CMM_INC if omitted. If a pre-defined variable is set more than once, only the last occurrence is used. User-defined variables must not be set more than once. ๐
๐ฅ Hotplug rules ๐ฅ
Set these pre-defined variables to an expression that resolves to a boolean value (true or false). These variables trigger hotplug actions. Setting a variable to "0" disables the action.
HOTPLUGโ used to enable CPUs.HOTUNPLUGโ used to disable CPUs.MEMPLUGโ used to increase the available memory.MEMUNPLUGโ used to decrease the amount of memory.
The following operators can be used in a hotplug rule expression:
+ * ( ) / - < >
Furthermore, the boolean operators & (and), | (or) and ! (not) can be used.
If both HOTPLUG and HOTUNPLUG evaluate to true, only the HOTPLUG action is triggered. If both MEMPLUG and MEMUNPLUG evaluate to true, only the MEMPLUG action is triggered. ๐
๐งฎ Pre-defined static variables ๐งฎ
The following pre-defined variables can be set only to a static, positive, numeric value:
CPU_MINโ the minimum number of CPUs to keep online (> 0).CPU_MAXโ the maximum number of CPUs to enable (>= 0).UPDATEโ the interval at whichcpuplugdevaluates the rules (in seconds,> 0).CMM_MINโ the minimum size of the CMM page pool (>= 0).CMM_MAXโ the maximum size of the CMM page pool (>= 0).
If the value of CPU_MAX is 0, the overall number of CPUs found in this system is used as the maximum. โจ
๐ Pre-defined dynamic variables ๐
The following pre-defined variables can either be set to a static value or to an algebraic expression:
CMM_INCโ the amount of pages by which the CMM page pool is increased if theMEMUNPLUGrule is matched (available system memory is decreased).CMM_DECโ the amount of pages by which the CMM page pool is decreased if theMEMPLUGrule is matched (available system memory is increased).
The following operators can be used in a dynamic variable expression:
+ * ( ) / - < >
๐ ๏ธ User-defined variables ๐ ๏ธ
You can specify complex calculations as user-defined variables, which can then be used in expressions. User-defined variables are case-sensitive and must not match a pre-defined variable or keyword. In the configuration file, definitions for user-defined variables must precede their use in expressions.
Variable names consist of alphanumeric characters (a-z,A-Z,0-9) and the "_" character, see section "EXAMPLES" for an example (pgscanrate). The maximum name length for a variable is 128 characters, and the maximum total size for all user-defined variables (names + values) is 4096 characters. ๐
โก Keywords for CPU hotplug rules โก
The HOTPLUG and HOTUNPLUG rules can contain the following pre-defined keywords:
loadavgโ the current load average.onumcpusโ the current number of CPUs which are online.runnable_procโ the current amount of runnable processes.userโ the current CPU user percentage.niceโ the current CPU nice percentage.systemโ the current CPU system percentage.idleโ the current CPU idle percentage.iowaitโ the current CPU iowait percentage.irqโ the current CPU irq percentage.softirqโ the current CPU softirq percentage.stealโ the current CPU steal percentage.guestโ the current CPU guest percentage (depends on kernel version: if not reported in/proc/stat, this is set to0).guest_niceโ the current CPU guest_nice percentage (depends on kernel version: if not reported in/proc/stat, this is set to0).cpustat.<name>โ data from/proc/statand/proc/loadavg.timeโ floating point timestamp in"seconds.microseconds"since the Unix Epoch (1970-01-01 00:00:00 +0000 (UTC)).
The percentage values are accumulated over all online CPUs, so they can vary between 0 and (100 * onumcpus). ๐ฆ
CPU usage data from /proc/stat and /proc/loadavg is accessible by specifying cpustat.<name>, where <name> can be any of the keywords described above, plus total_ticks. In this case, loadavg, onumcpus and runnable_proc provide the same values as the pre-defined keywords, while the others refer to the raw timer ticks as reported by /proc/stat, not the percentage. For example, cpustat.idle reports the timer ticks spent in idle since system start, and cpustat.total_ticks indicates the sum of all reported timer ticks, which can be useful for user-defined percentage calculations. ๐ฅ
๐ Keywords for memory hotplug rules ๐
The MEMPLUG and MEMUNPLUG rules can contain the following pre-defined keywords:
apcrโ the amount of page cache operations, i.e.pgpin + pgpoutfrom/proc/vmstat(in512byte blocks / second).freememโ the amount of free memory (in megabytes).swaprateโ the number of swap operations, i.e.pswpin + pswpoutfrom/proc/vmstat(in pages / second).meminfo.<name>โ any value from/proc/meminfo.vmstat.<name>โ any value from/proc/vmstat.timeโ floating point timestamp in"seconds.microseconds"since the Unix Epoch (1970-01-01 00:00:00 +0000 (UTC)).
All values from /proc/meminfo and /proc/vmstat can be used in an expression by specifying meminfo.<name> or vmstat.<name>, where <name> matches a symbol name reported by /proc/meminfo or /proc/vmstat (case sensitive), e.g. meminfo.MemTotal. ๐
โณ History function โณ
There is a history function for the following keywords:
cpustat.<name>โ data from/proc/statand/proc/loadavg.meminfo.<name>โ any value from/proc/meminfo.vmstat.<name>โ any value from/proc/vmstat.timeโ floating point timestamp in"seconds.microseconds"since the Unix Epoch (1970-01-01 00:00:00 +0000 (UTC)).
The history levels can be accessed by appending [<history level>] to the name, where <history level> indicates the amount of past intervals where the value was gathered. [0] means the current interval (the [0] can be omitted in this case), [1] means the previous interval, [2] means two intervals ago, and so on. The history limit is 100. For example, cpustat.system[1] would indicate the system value from /proc/stat at the previous interval, while vmstat.pgpgin and vmstat.pgpgin[0] would both mean the current pgpgin value from /proc/vmstat. ๐ง
The time keyword and its history values can be used to calculate values dependent on time intervals, see section "EXAMPLES" for an example (pgscanrate). โจ
๐งช EXAMPLES ๐งช
A complete configuration file could look like this:
------------------------------ config file start ------------------------------
UPDATE="5"
CPU_MIN="2"
CPU_MAX="5"
CMM_MIN="0"
CMM_MAX="131072" # 512 MB
pgscan_k="vmstat.pgscan_kswapd_dma + vmstat.pgscan_kswapd_normal + vmstat.pgscan_kswapd_movable"
pgscan_d="vmstat.pgscan_direct_dma + vmstat.pgscan_direct_normal + vmstat.pgscan_direct_movable"
pgscan_k1="vmstat.pgscan_kswapd_dma[1] + vmstat.pgscan_kswapd_normal[1] + vmstat.pgscan_kswapd_movable[1]"
pgscan_d1="vmstat.pgscan_direct_dma[1] + vmstat.pgscan_direct_normal[1] + vmstat.pgscan_direct_movable[1]"
pgscanrate="(pgscan_k + pgscan_d - pgscan_k1 - pgscan_d1) / (time - time[1])"
cache="meminfo.Cached + meminfo.Buffers"
# CMM_INC: 10% of free memory + cache, in 4K pages
CMM_INC="(meminfo.MemFree + cache) / 40"
# CMM_DEC: 10% of total memory in 4K pages
CMM_DEC="meminfo.MemTotal / 40"
HOTPLUG = "(loadavg > onumcpus + 0.75) & (idle < 10.0)"
HOTUNPLUG = "(loadavg < onumcpus - 0.25) | (idle > 50)"
# Plug memory if page scan rate is above 20 pages / sec
MEMPLUG = "pgscanrate > 20"
# Unplug memory while free memory is above 10% of total memory, or cache uses
# more than 50% of total memory
MEMUNPLUG = "(meminfo.MemFree > meminfo.MemTotal / 10) | (cache > meminfo.MemTotal / 2)"
------------------------------ config file end ------------------------------
The example includes multiple user-defined variables to calculate the page scan rate with values from /proc/vmstat, as well as the cache size. ๐
โ ๏ธ Attention: Do not use these example rules on production systems. The rules have been designed to illustrate the configuration file syntax and are not suitable for actually governing hotplug actions. Useful rules differ considerably depending on the workload, resources, and requirements of the system they are designed for. ๐
๐ SEE ALSO ๐
cpuplugd(8)โ go read that next, bestie.
signed, sealed, and slayed by s390-tools โ dated May 2011 โ and the manual name on the cover is CPUPLUGD.CONF(5), periodt ๐
โจ
๐ฆ where this page comes from
- opensuse-leap 16.0: s390-tools 2.44.1-160000.1.1 ยท MIT
- Copyright 2017 IBM Corp
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms