HCE-specific Kernel Parameters
Compared with CentOS 8, HCE 2.0 has some custom kernel parameters.
Kernel Parameters
The following parameters are from the files in the /proc/sys/kernel and /sys/kernel directories.
Task scan
Automatic NUMA balancing scans the address space of a task and cancels page mapping to check whether the page is correctly placed or whether data should be migrated to the memory node local to where the task is running. Each time a scan is delayed, the task scans the next number of pages in its address space. When the end of the address space is reached, the scanner starts from the beginning.
The scan delay and scan size determine the scan rate. When the scan delay decreases, the scan rate increases. The scan delay and the scan rate of every task are adaptive and depend on historical behavior. If pages are properly placed, the scan delay increases. Otherwise, the scan delay decreases. The scan size is not adaptive. However, a larger scan size indicates a higher scan rate.
A higher scan rate results in higher system overhead because page errors must be trapped and data must be migrated. However, the higher the scan rate, the faster the memory of the task is migrated to the local node. If the workload pattern changes, this minimizes performance impact due to remote memory accesses. Parameters in Table 1 control the thresholds for the scan delay and the number of pages scanned.
| Parameter | Description | Value |
|---|---|---|
| kernel.numa_balancing_scan_delay_ms | Specifies the starting scan delay used for a task when it initially forks. | Default value: 1000 (unit: ms) |
| kernel.numa_balancing_scan_period_max_ms | Specifies the maximum time to scan a task's virtual memory. It effectively controls the minimum scan rate for each task. | Default value: 60000 (unit: ms) |
| kernel.numa_balancing_scan_period_min_ms | Specifies the minimum time to scan a task's virtual memory. It effectively controls the maximum scanning rate for each task. | Default value: 1000 (unit: ms) |
| kernel.numa_balancing_scan_size_mb | Defines the size of the page to be scanned each time. | Default value: 256 (unit: MB) |
CFS
The Completely Fair Scheduler (CFS) uses nanosecond granularity accounting and does not rely on any jiffies or other HZ detail. Thus, it has no notion of "time slices" in the way the previous scheduler had, and has no heuristic algorithms. There is only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):
/proc/sys/kernel/sched_min_granularity_ns
CFS is not prone to any of the attacks (such as fiftyp.c, thud.c, chew.c, ring-test.c, and massive_intr.c) on heuristic algorithms of conventional schedulers. So, the interactivity will not be affected.
CFS has much stronger handling of nice levels and SCHED_BATCH than the previous vanilla scheduler: both types of workloads are isolated much more aggressively. SMP load balancing has been reworked/sanitized: the runqueue-walking assumptions are gone from the load-balancing code now, and iterators of the scheduling modules are used. As a result, the load balancing code becomes simpler.
| Parameter | Description | Value |
|---|---|---|
| kernel.sched_min_granularity_ns | Tunes the scheduler from "desktop" (low latency) to "server" (good batch processing) workloads. The default value is suitable for desktop workloads. SCHED_BATCH is handled by the CFS scheduler module too. | Default value: 3000000 (unit: ns) |
Fault locating
| Parameter | Description | Value |
|---|---|---|
| kernel.net_res_debug_enhance | When a large number of packets are sent and received, the resources of the kernel stack may be insufficient or exceed the thresholds. As a result, the user-mode socket and send interfaces fail to return responses, or packet loss occurs. If this option is enabled, the fault locating information is recorded in the system log. The value 1 indicates this option is enabled, and 0 indicates this option is disabled. | Default value: 0 |
OOM event fault locating
The product/platform service software or OS may have insufficient memory due to a special reason, which triggers an OOM event. Kbox can record the time when an OOM event occurs, details about the OOM process, and system process information in the storage device, facilitating fault locating.
| Parameter | Description | Value |
|---|---|---|
| kernel.oom_enhance_enable | Specifies whether to enable OOM information printing. | 0: disabled 1: enabled (default) |
| kernel.oom_print_file_info | Specifies whether to print file system information. | 0: disabled 1: enabled (default) |
| kernel.oom_show_file_num_in_dir | Specifies the number of files in the printed file system information. | Default Value: 10 |
SMT expeller
| Parameter | Description | Value |
|---|---|---|
| kernel.qos_offline_wait_interval_ms | Specifies the sleep time (in milliseconds) of the offline task before entering the user mode in the event of overload. | Value range: [100-1000] Default value: 100 (unit: ms) |
| kernel.qos_overload_detect_period_ms | Specifies a period of time, in milliseconds. If the online task has been occupying a CPU's resources for a period longer than the value specified by this parameter, the process of resolving priority inversion is triggered. | Value range: [100-100000] Default value: 5000 (unit: ms) |
The two parameters are new openEuler kernel parameters. For details, see SMT Expeller Free of Priority Inversion in the openEuler Technical White Paper.
Compute statistics
Due to factors such as turbo frequency, tuning, SMT, and big and small cores on the same node, the CPU usage collected by the cpuacct subsystem cannot reflect the actual compute. The difference between the compute represented by the CPU usage on different nodes can reach over 30%. Compute statistics is used to resolve the problem that the duty cycle cannot reflect the actual CPU compute usage. The cgroup's CPU usage derived based on the actual compute can better represent service performance metrics compared with duty cycle. The impact of SMT is mainly considered in compute statistics.
| Parameter | Description | Value |
|---|---|---|
| kernel.normalize_capacity.sched_normalize_util | Specifies whether to enable CPU usage normalization. | 0: disabled (default) 1: enabled |
| kernel.normalize_capacity.sched_single_task_factor | In hyper-threading scenarios, set the compute coefficient for independently running logical cores. The value ranges from 1 to 100. A larger value indicates higher compute of the logical cores. | Value range: 1 to 100 Default value: 100 |
| kernel.normalize_capacity.sched_multi_task_factor | In hyper-threading scenarios, set the compute coefficient for running logical cores in parallel. The value ranges from 1 to 100. A larger value indicates higher compute of the logical cores. | Value range: 1 to 100 Default value: 60 |
| kernel.normalize_capacity.sched_normalize_adjust | Specifies whether to enable compute compensation. The value can be read and written. | 0: disabled (default) 1: enabled |
Usage of preferred CPU
| Parameter | Description | Value |
|---|---|---|
| kernel.sched_util_low_pct | Specifies the usage threshold of the preferred CPU. When the preferred CPU usage is lower than the threshold, services cannot select cores from the preferred CPU. They can only select cores from the allowed CPU. | Default value: 85 |
Watchdog detection period
In addition to kernel watchdog functions, watchdog invalidity caused by incorrect reset for lockups can be detected. In this case, failure information will be recorded or displayed, helping R&D and O&M personnel quickly locate faults. The sysctl parameter is added for the watchdog detection period. The detection and alarm log printing periods can be dynamically adjusted based on product requirements.
| Parameter | Description | Value |
|---|---|---|
| kernel.watchdog_enhance_enable | Specifies whether to enable watchdog enhancement. | 0: disabled 1: enabled (default) NOTE: Other values indicate enabled. The recommended values are 0 and 1. |
| kernel.watchdog_softlockup_divide | Adjusts the watchdog detection interval, in seconds. The value can be calculated using the formula: The value of kernel.watchdog_thresh × 2/The value of kernel.watchdog_softlockup_divide | Value range: [1, 60] Default value: 5 (unit: s) |
| kernel.watchdog_print_period | Specifies the interval (in seconds) for printing process information after the watchdog detects that a process is not scheduled. | Value range: [1, 60] Default value: 10 (unit: s) |
Interrupt storm detection
After this feature is enabled, the CPU status is collected at a fixed interval when a soft lockup occurs. By default, the CPU status is collected five times. The report includes the percentages of system runtime, software interrupt time, hardware interrupt time, and idle time in a sampling period, helping developers analyze whether an interrupt storm occurs.
| Parameter | Description | Value |
|---|---|---|
| kernel.interrupt_storm_detector_enable | Specifies whether to enable interrupt storm detection. | 0: disabled 1: enabled |
CPU QoS interface compatibility
| Parameter | Description | Value |
|---|---|---|
| kernel.sched_qos_level_0_has_smt_expell | Controls whether to enable CPU QoS interface compatibility after hybrid deployment levels are increased from 2 to 5 for CCE clusters that use HCE. 0 indicates the compatibility is disabled, which means that 5-level CPU QoS is used. When compatibility is required, you can enable the compatibility by setting the value to 1 so that the semantics of priority 0 remains unchanged when there are both online and offline workloads. | Default value: 0 |
Dynamic adjustment of frequency
| Parameter | Description | Value |
|---|---|---|
| kernel.actual_hz | Controls whether to dynamically adjust the frequency. 0 indicates dynamic adjustment is disabled. In this case, the default frequency 1,000 Hz will be used. | Value range: [0, 1000] Default value: 0 |
kernel scheduler
| Parameter | Description | Value |
|---|---|---|
| kernel.sched_latency_ns | Defines the initial value for the scheduler period. The scheduler period is a period of time during which all runnable tasks should be allowed to run at least once. | Default value: 24000000 (unit: ns) |
| kernel.sched_migration_cost_ns | Specifies the amount of time after the last execution that a task is considered to be "cache hot" in migration decisions. A "hot" task is less likely to be migrated, so increasing this variable reduces task migrations. | Default value: 500000 (unit: ns) |
| kernel.sched_nr_migrate | If a SCHED_OTHER task spawns a large number of other tasks, they will all run on the same CPU. The migration task or softirq will try to balance these tasks so that they can run on idle CPUs. This option can be set to specify the number of tasks to be moved at a time. | Default value: 32 |
| kernel.sched_tunable_scaling | Automatic adjustment of the value of sched_min_granularity_ns/sched_latency_ns/sched_wakeup_granularity_ns based on the number of online CPUs. | 0: no adjustment 1: logarithmic adjustment (with 2 as the base) 2: linear adjustment Default value: 1 |
| kernel.sched_wakeup_granularity_ns | Gives preemption granularity when tasks wake up. | Default value: 4000000 (unit: ns) |
| kernel.sched_autogroup_enabled | Controls whether to enable autogroup scheduling. If enabled, all members in an autogroup belong to the same task group of the kernel scheduler. The CFS scheduler uses an algorithm to evenly allocate CPU clock cycles among task groups. | 0: disabled (default) 1: enabled |
Dynamic affinity in scheduler
| Parameter | Description | Value |
|---|---|---|
| kernel.sched_dynamic_affinity_disable | Controls whether to disable dynamic affinity in scheduler. | 0: enabled (default) 1: disabled. |
CPU QoS priority-based load balancing
For details about new kernel parameters of openEuler, see CPU QoS Priority-based Load Balancing in the openEuler Technical White Paper.
| Parameter | Description | Value |
|---|---|---|
| kernel.sched_prio_load_balance_enabled | Specifies whether to enable CPU QoS priority-based load balancing. The value 0 indicates that this option is disabled, and 1 indicates that this option is enabled. | Values: 0 or 1 Default value: 0 |
Core suspension detection
CPU core suspension is a special issue. When this issue occurs, the CPU core cannot execute any instructions or respond to interrupt requests. So, kernel tests cannot cover this issue. Chips need to use a simulator to locate the root cause. To improve the efficiency of locating faults, core suspension detection is provided for kernels to check whether core suspension occurs.
| Parameter | Description | Value |
|---|---|---|
| kernel.corelockup_thresh (only for Arm) | If the threshold is set to x and a CPU does not receive hrtimer and NMI interrupts for x consecutive times, the CPU core will be suspended. | Default value: 5 |
Idle polling control
| Parameter | Description | Value |
|---|---|---|
| kernel.halt_poll_threshold (only for Arm) | If idle pooling is enabled, the guest OS kernel performs idle polling before entering the idle state, without VM-exit. kernel.halt_poll_threshold determines the idle polling duration. During idle polling, task scheduling will not increase Inter-Processor Interrupt (IPI) overheads. | Default value: 0 Value range: 0 to max(uint64) |
Reset failures in User to Core Environment (UCE)
| Parameter | Description | Value |
|---|---|---|
| kernel.machine_check_safe (only for Arm) | Ensure that CONFIG_ARCH_HAS_COPY_MC is enabled in the kernel. If /proc/sys/kernel/machine_check_safe is set to 1, machine check is enabled. If it is set to 0, machine check is disabled. Other values are invalid. | Default value: 1 Values: 0 or 1 |
Printing source IP addresses upon network packet verification errors
When hardware errors occur or networks are under attack, the kernel receives network packets with verification errors and discards them. As a result, the sources of the data packets cannot be located. This feature provides fault locating in this case. After the verification fails, the source IP addresses of the data packets are printed in system logs.
| Parameter | Description | Value |
|---|---|---|
| kernel.net_csum_debug (only for Arm) | This parameter is only available in Arm. | 0: disabled (default) 1: enabled |
Cluster scheduling
| Parameter | Description | Value |
|---|---|---|
| kernel.sched_cluster (only for Arm) | - | 0: disabled 1: enabled (default) |
Printing alarms of processes in the D state
The TASK_UNINTERRUPTIBLE state is an uninterruptible sleep state, that is, the D state. When a process is in the D state, the process neither occupies the CPU nor receives response signals. So, you cannot kill a task in the D state. Instead, you can only wait for other processes to wake it up. A process enters the D state when waiting for I/O operations to complete, calling mutex_lock, waiting for accessing shared resources after calling down, and waiting for other events to complete after calling wait_for_completion series interfaces.
In normal cases, a process will not stay in the D state for a long time. When the conditions are met, the process will be woken up. However, if an I/O read/write exception or mutex deadlock occurs, the process may stay in the D state for a long time. To solve this problem, the kernel uses hungtask detection. When detecting a hung task, the kernel prints alarms and triggers a panic to restart the system.
| Parameter | Description | Value |
|---|---|---|
| kernel.hung_task_warning_timeout_secs | Specifies the threshold for triggering alarm printing. A value x indicates that an alarm will be printed x seconds after a process enters the D state. 0 indicates alarm printing is disabled. | Default value: 60 |
Kernel-mode container resource view
This feature enhances the visibility of container resources at the kernel level. After this feature is enabled, when you run commands such as top and free in a container, container resource information instead of host resource information will be displayed.
| Parameter | Description | Value |
|---|---|---|
| kernel.enhance_container_enable | Controls whether to enable the container resource view. | 0: disabled (default). Processes inside a container see host-level values. 1: enabled. Processes inside a container see container-scoped values. |
| kernel.enhance_container_cgroup_source | Controls which cgroup is used as the data source. | 0 (default): The data source is the cgroup that the current pointer points to. 1: The data source is the cgroup that the child reaper pointer (process 1 in the current PID namespace) points to. |
Slow block I/O detection
A parameter can be used to control whether to enable slow I/O detection. By default, slow I/O detection is enabled.
| Parameter | Description | Value |
|---|---|---|
| kernel.slowio_monitor_enable | Controls whether to enable slow I/O detection. You can run a sysctl command to set it. Alternatively, you can use a sysctl configuration file to make the settings persistent. | Value: 0 or 1 The value is of the bool type. The default value is 1. 0: disabled; 1: enabled. |
Parameters in the /proc/sys/net Directory
The following parameters are from the files in the /proc/sys/net directory.
TCP socket buffer control
| Parameter | Description | Value |
|---|---|---|
| net.ipv4.tcp_rx_skb_cache | Controls the cache of each TCP socket of an SKB, which may help improve the performance of some workloads. This option can be dangerous on systems with a large number of TCP sockets because it increases memory usage. | The default value is 0, indicating that this option is disabled. |
Network namespace control
| Parameter | Description | Value |
|---|---|---|
| net.netfilter.nf_namespace_change_enable | Specifies whether a non-initialized network namespace is read-only. | Default value: 0 |
Querying VF information and displaying the broadcast address
| Parameter | Description | Value |
|---|---|---|
| net.core.vf_attr_mask | Determines whether to display the broadcast address when netlink is used to query VF link information (for example, the ip linkshow command). This parameter is the same as that in the community. | 1 (default): The broadcast address is displayed. |
Custom TCP retransmission rules
The TCP packet retransmission of HCE complies with the exponential backoff principle. In a low-quality network, the packet loss rate and latency are high. To address this issue, custom TCP retransmission rules can be created by using programming interfaces. You can specify the number of linear backoffs, maximum number of retransmissions, and maximum retransmission interval, to reduce the packet loss rate and latency in a low-quality network.
| Parameter | Description | Value |
|---|---|---|
| net.ipv4.tcp_sock_retrans_policy_custom | Determines whether to enable custom TCP retransmission rules. | 0: disabled (default) 1: enabled |
TCP delay ACK
In TCP communications, after receiving a data packet, the receiver usually sends an acknowledgment (ACK) message. If an ACK message is sent immediately after each packet is received, a large number of small packets will be generated, wasting bandwidth. Delay ACK is used to delay the sending of ACK messages for a while. In this way, an ACK message and response data can be sent together, or multiple packets can be acknowledged at a time. This feature is enabled by default. You can disable it so that ACK messages can be sent immediately.
| Parameter | Description | Value |
|---|---|---|
| net.ipv4.tcp_no_delay_ack | Controls whether to enable TCP delay ACK. 0: TCP delay ACK is enabled. 1: TCP delay ACK is disabled. | Value: 0 or 1 0: TCP delay ACK is enabled. 1: TCP delay ACK is disabled. |
TCP TIME_WAIT timeout
When one end of a TCP connection sends a FIN message to terminate the connection and receives an ACK message from the other end, the connection cannot be released immediately. Instead, the connection enters the TIME_WAIT state to wait for the release. In this state, the socket still occupies the local port. You can configure the TIME-WAIT timeout period.
| Parameter | Description | Value |
|---|---|---|
| net.ipv4.tcp_tw_timeout | Specifies the TCP TIME-WAIT timeout period, in milliseconds. | Default value: 60,000 ms (60s) Value range: [1000, 600,000] |
IPv6 re-path to avoid congestion
Cloud DCN networks have various paths and use Equal Cost Multi Path (ECMP) to balance loads and reduce conflicts. In the case of dynamic bursts or fluctuant flow sizes, load imbalance and congestion hotspots can still occur.
IPv6 re-path balances network loads through device-side congestion detection and path switching to improve the service flow throughput and reduce transmission latency. The sender side dynamically detects the network congestion status and evaluates whether path switching is necessary. If it is necessary, the sender side performs re-path to switch to a light-load path, thereby avoiding network congestion hotspots.
| Parameter | Description | Value |
|---|---|---|
| net.ipv6.tcp_repath_cong_thresh | Number of consecutive congestion rounds allowed during idle hours. If the number is exceeded, path switching will be performed. | Value range: 1 to 8192 Default value: 10 |
| net.ipv6.tcp_repath_enabled | 0 indicates IPv6 re-path is disabled and 1 indicates it is enabled. | Values: 0 or 1 Default value: 0 |
| net.ipv6.tcp_repath_idle_rehash_rounds | Number of consecutive congestion rounds allowed during non-idle hours. If the number is exceeded, path switching will be performed. | Value range: 3 to 31 Default value: 3 |
| net.ipv6.tcp_repath_rehash_rounds | Percentage of lost packets allowed in a round. If the threshold is exceeded, congestion occurs in the round. | Value range: 3 to 31 Default value: 3 |
| net.ipv6.tcp_repath_times_limit | Maximum number of path switching operations per second. | Value range: 1 to 10 Default value: 2 |
Network PPS performance tuning
For a large-specification VM (for example, 192 vCPUs) using the HCE 5.10 kernel, the net.core.high_order_alloc_disable parameter can be used to improve the network PPS performance when the number of concurrent requests is greater than 8.
| Parameter | Description | Temporary Settings | Permanent Settings |
|---|---|---|---|
| net.core.high_order_alloc_disable | This parameter is used to disable high-order page allocation so that network PPS performance can be improved. 0 indicates high-order page allocation is not disabled. 1 indicates high-order page allocation is disabled and order-0 pages will be allocated. Default value: 0 | Run sysctl -w net.core.high_order_alloc_disable=1. After a restart, the parameter value will be restored to the default one. |
After a restart, the parameter value remains unchanged. |
If net.core.high_order_alloc_disable is set to 1, order-0 pages will be allocated. 1 is recommended for high-concurrency TCP and UDP services (the number of concurrent requests is greater than 8) to improve network performance. You can set it to 0 for low-concurrency services. net.core.high_order_alloc_disable=0 may deteriorate network performance.
Parameters in the /proc/sys/vm Directory
The following parameters are from the files in the /proc/sys/vm directory.
Periodic reclamation
| Parameter | Description | Value |
|---|---|---|
| vm.cache_reclaim_s | Specifies the interval for periodically reclaiming memory. When periodic memory reclamation is enabled, the memory is reclaimed at an interval defined by cache_reclaim_s (unit: s). | Default value: 0 |
| vm.cache_reclaim_weight | This is used to speed up page cache reclaim. When periodic memory reclamation is enabled, the amount of memory reclaimed each time can be calculated using the following formula: reclaim_amount = cache_reclaim_weight × SWAP_CLUSTER_MAX × nr_cpus_node(nid)
Workqueue is used to reclaim memory. If the memory reclamation task is time-consuming, subsequent work will be blocked, which may affect time-sensitive work. | Default value: 1 |
| vm.cache_reclaim_enable | Specifies whether to enable periodic memory reclamation. | Default value: 1 |
Page cache upper limit
| Parameter | Description | Value |
|---|---|---|
| vm.cache_limit_mbytes | Limits the page cache amount, in MB. If the page cache exceeds the limit, the page cache is periodically reclaimed. | Default value: 0 |
Maximum batch size and high watermark
| Parameter | Description | Value |
|---|---|---|
| vm.percpu_max_batchsize | Specifies the maximum batch size and high watermark per CPU in each region. |
|
Maximum fraction of pages
| Parameter | Description | Value |
|---|---|---|
| vm.percpu_pagelist_fraction | Defines the maximum fraction (with high watermark pcp->high) of pages in each zone that can be allocated for each per-cpu page list. The minimum value is 8, which means that up to one-eighth of the pages in each zone can be allocated for each per-CPU page list. This entry only changes the value of each hot per-CPU page list. A user can specify a number like 100 to allocate 1/100th of pages in each zone for each per-CPU list. The batch value of each per-CPU page list will be updated accordingly and set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT x 8). The initial value is zero. The kernel does not use this value to set the high watermark for each per-CPU page list at startup. If the user writes 0 to this sysctl, it will revert to the default behavior. | Default value: 0 |
Memory priority classification
| Parameter | Description | Value |
|---|---|---|
| vm.memcg_qos_enable | Dynamically enables memory priority classification. The value 0 indicates that this option is disabled, and 1 indicates that this option is enabled. | Default value: 0 |
Virtual address cycle for mmap loading
| Parameter | Description | Value |
|---|---|---|
| vm.mmap_rnd_mask | This parameter can be used to set any number of bits of the virtual address loaded by the mmap to 0 to control the virtual address period loaded by the mmap. | Default value: null |
Hugepage management
| Parameter | Description | Value |
|---|---|---|
| vm.hugepage_mig_noalloc | When hugepages are migrated from one NUMA node to another, if the number of available hugepages on the destination NUMA node is insufficient, the system determines whether to allocate new hugepages based on the value of this parameter. Set 1 to forbid new hugepage allocation in hugepage migration when hugepages on the destination node run out. Set 0 to allow hugepage allocation in hugepage migration as usual. | Default value: 0 |
| vm.hugepage_nocache_copy (only for x86) | In the x86 architecture, when hugepages are migrated to the NUMA node where Intel AEP is used, this parameter determines the way to copy hugepages. If the value is 1, the NT instruction is used. If the value is 0, the native MOV instruction is used. | Default value: 0 |
| vm.hugepage_pmem_allocall | During hugepage allocation on the NUMA node where Intel AEP is used, this parameter determines whether to limit the number of hugepages. If the value is 0, the number of hugepages that can be converted to is limited by the kernel threshold. If the value is 1, all available memory can be applied as hugepages. | Default value: 0 |
vmemmap memory source
| Parameter | Description | Value |
|---|---|---|
| vm.vmemmap_block_from_dram | Controls whether to apply the vmemmap memory from the AEP when the AEP memory is hot added to the system NUMA node. If the value is 1, the memory is from the DRAM. If the value is 0, the memory is from the corresponding AEP. | Default value: 0 |
Memory overcommitment
| Parameter | Description | Value |
|---|---|---|
| vm.swap_madvised_only | Specifies whether to enable memory overcommitment. 1 indicates this option is enabled. 0 indicates this option is disabled. | Default value: 0 |
QEMU hot replacement
| Parameter | Description | Value |
|---|---|---|
| vm.enable_hotreplace | Specifies whether to enable QEMU hot replacement. This option supports quick QEMU version upgrade without interrupting services. It can be used in the host OS hot patch and cannot be enabled for the guest OS. The value can be 0 or 1. | The default value is 0, indicating that this option is disabled. |
Slab allocation
Slab allocation is used to cache kernel data to reduce memory fragmentation and improve system performance. However, as the process progresses, the slabs may occupy a large amount of memory. Enabling drop_slabs can release the cache to increase the available memory of the host.
| Parameter | Description | Value |
|---|---|---|
| vm.drop_slabs | 0 indicates that the cache will not be released. 1 indicates that the cache will be released. | Values: 0 or 1 Default value: 1 |
| vm.drop_slabs_limit | Priority. A larger value indicates that fewer slabs will be released. This is to prevent the CPU from being occupied for a long time when too many slabs are being released. | Value range: an integer in the range [0, 12] Default value: 7 |
cgroup isolation for ZRAM memory compression
This feature binds memcgs and ZRAM devices. A specified memcg can use a specified ZRAM device, and the memory used by the ZRAM device is obtained from the memory of the container in the group.
| Parameter | Description | Value |
|---|---|---|
| vm.memcg_swap_qos_enable | Read and write interface. The default value is 0, indicating that the feature is disabled. If the value is 1, memory.swapfile of all memcgs is set to all. If the value is 2, memory.swapfile of all memcgs is set to none. If the value is 1 or 2 and you want to change it to another value, you need to set the value to 0. | Values: 0, 1, or 2 Default value: 0 |
Disabling swapping globally
In the community kernel, if swappiness is set to 0, the kernel avoids swapping as much as possible swap_extension is provided to disable swapping globally. This will forcibly prevent anonymous pages from being swapped out.
| Parameter | Description | Value |
|---|---|---|
| vm.swap_extension | Disables swapping globally to forcibly prevent anonymous pages from being swapped out.
| Values: 0, 1, 2, or 3 Default value: 0 |
kernel memory watermarks
| Parameter | Description | Value |
|---|---|---|
| vm.lowmem_reserve_dma_ratio | If the GFP flag (such as GFP_DMA) is not used to express how that memory should be allocated, when the memory in ZONE_HIGHMEM is insufficient, the memory can be allocated from the low-end ZONE_NORMAL. When the memory in ZONE_NORMAL is insufficient, the memory can be allocated from the low-end ZONE_DMA32. "low-end" means that the physical memory address of the zone is smaller. "insufficient" means that the free memory of the current zone is less than the requested memory. Except ZONE_HIGHMEM, other zones reserve memory for the zone that has higher physical memory address, and the reserved memory is called lowmem reserve. The default value is DMA/normal/HighMem: 256 320, in pages. | Default value: 0 |
OOM incident management
In some cases, you may hope that OOM does not kill the processes. Instead, the black box can report the incidents and trigger crashes to locate faults.
| Parameter | Description | Value |
|---|---|---|
| vm.enable_oom_killer (only for Arm) | 1 indicates OOM incident management is enabled and 0 indicates it is disabled. | Default value: 0 |
Memory UCE error collection and reporting
After this feature is enabled, the system collects error information and sends an alarm to the alarm forwarding service when a memory UCE error occurs. Then, the programs that subscribe to the memory UCE fault event can receive the alarm and handle it. This way, memory UCE errors can be detected in real time and handled in a timely manner.
| Parameter | Description | Value |
|---|---|---|
| vm.uce_handle_event_enable | Controls whether to enable the kernel memory to report UCE errors. 0 indicates disabled and other values indicate enabled. | Default value: 0 |
Zombie memcg reclamation
| Parameter | Description | Value |
|---|---|---|
| vm.memcg_recycle_enable | Controls whether to enable or disable zombie memcg reclamation in the background. 1 indicates enabled and 0 indicates disabled. | Default value: 1 |
| vm.memcg_recycle_threshold | Threshold of zombie memcgs. When the number of zombie memcgs exceeds the threshold, the system starts to reclaim them. | Value range: [200 – INTMAX] Default value: 512 |
| vm.memcg_recycle_pages_scan | Number of pages to be reclaimed in each period. This parameter determines the reclamation speed. Too fast reclamation may cause high CPU usage. | Value range: [0 - LONGMAX] Default value: 32768 |
- Background reclamation of zombie memcgs consumes a certain amount of CPU. You can enable or disable background reclamation and adjust the zombie memcg threshold and reclamation speed as you need.
- The page cache of a memory file system such as tmpfs cannot be reclaimed. So, the zombie memcgs of these file systems cannot be reclaimed.
Parameters in the /proc/sys/mce Directory
The following parameters are from the files in the /proc/sys/mce directory.
UCE mechanism enhancement
| Parameter | Description | Value |
|---|---|---|
| mce.mce_kernel_recover (only for x86) | Controls whether to enable the kernel UCE mechanism enhancement. The value 1 indicates this option is enabled. You can run the following command to disable this option: echo 0 > /proc/sys/mce/mce_kernel_recover | Default value: 1 |
Parameters in the /proc/sys/debug Directory
The following parameters are from the files in the /proc/sys/debug directory.
System exception notification
When an oops occurs, the kernel enters the die process and panic process. In this case, the callback functions registered with the die and panic notification chains are called. If the callback functions cause the kernel oops, the kernel enters the oops process. When the callback functions are called again in the oops process, an oops occurs again, and there is a nested oops. As a result, the system is suspended.
To enhance system fault locating and reliability, the system exception notification chain is introduced. When a nested oops occurs in the panic or die notification chain registered by a user, error logs are printed, and the crash process is executed to reset the system.
| Parameter | Description | Value |
|---|---|---|
| debug.nest_oops_enhance | Controls whether to enable the nested oops enhancement interface of the panic notification chain. | The default value is 1, indicating that this option is enabled. |
| debug.nest_panic_enhance | Controls whether to enable the nested oops enhancement interface of the die notification chain. | The default value is 1, indicating that this option is enabled. |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot