# Runtime settings with sysctl

---

# Documentation for /proc/sys

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> Copyright (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>

> **Peios:** References to Unix root and file modes below describe the inherited interface conventions. They are not sufficient Peios authorization: native descriptor/handle checks, the separate sysfs write gate, and mapped native privileges apply as appropriate. Debugfs additionally remains subject to integrity lockdown. See [Peios kernel behaviour](</kernel/introduction/peios-behaviour.md>).


<a id="rst-documentation-for-proc-sys"></a>

Copyright (c) 1998, 1999,  Rik van Riel &lt;[riel@nl.linux.org](<mailto:riel@nl.linux.org>)&gt;

---

'Why', I hear you ask, 'would anyone even \_want\_ documentation for them sysctl files? If anybody really needs it, it's all in the source...'

Well, this documentation is written because some people either don't know they need to tweak something, or because they don't have the time or knowledge to read the source code.

Furthermore, the programmers who built sysctl have built it to be actually used, not just for the fun of programming it :-)

---

Legal blurb:

As usual, there are two main things to consider:

1. you get what you pay for

2. it's free

The consequences are that I won't guarantee the correctness of this document, and if you come to me complaining about how you screwed up your system because of wrong documentation, I won't feel sorry for you. I might even laugh at you...

But of course, if you \_do\_ manage to screw up your system using only the sysctl options used in this file, I'd like to hear of it. Not only to have a great laugh, but also to make sure that you're the last RTFMing person to screw up.

In short, e-mail your suggestions, corrections and / or horror stories to: &lt;[riel@nl.linux.org](<mailto:riel@nl.linux.org>)&gt;

Rik van Riel.

---

<a id="rst-introduction"></a>

## Introduction

Sysctl is a means of configuring certain aspects of the kernel at run-time, and the /proc/sys/ directory is there so that you don't even need special tools to do it\! In fact, there are only four things needed to use these config facilities:

- a running Linux system

- root access

- common sense (this is especially hard to come by these days)

- knowledge of what all those values mean

As a quick 'ls /proc/sys' will show, the directory consists of several (arch-dependent?) subdirs. Each subdir is mainly about one part of the kernel, so you can do configuration on a piece by piece basis, or just some 'thematic frobbing'.

This documentation is about:


<table>
<tbody>
<tr>
<td>


abi/

</td>
<td>


execution domains &amp; personalities

</td>
</tr>
<tr>
<td>


&lt;$ARCH&gt;

</td>
<td>


tuning controls for various CPU architecture (e.g. csky, s390)

</td>
</tr>
<tr>
<td>


crypto/

</td>
<td>


&lt;undocumented&gt;

</td>
</tr>
<tr>
<td>


debug/

</td>
<td>


&lt;undocumented&gt;

</td>
</tr>
<tr>
<td>


dev/

</td>
<td>


device specific information (e.g. dev/cdrom/info)

</td>
</tr>
<tr>
<td>


fs/

</td>
<td>


specific filesystems filehandle, inode, dentry and quota tuning binfmt_misc &lt;[Documentation/admin-guide/binfmt-misc.rst](/kernel/administration/admin-guide/compatibility/binfmt-misc.md)&gt;

</td>
</tr>
<tr>
<td>


kernel/

</td>
<td>


global kernel info / tuning miscellaneous stuff some architecture-specific controls security (LSM) stuff

</td>
</tr>
<tr>
<td>


net/

</td>
<td>


networking stuff, for documentation look in: &lt;Documentation/networking/&gt;

</td>
</tr>
<tr>
<td>


proc/

</td>
<td>


&lt;empty&gt;

</td>
</tr>
<tr>
<td>


sunrpc/

</td>
<td>


SUN Remote Procedure Call (NFS)

</td>
</tr>
<tr>
<td>


user/

</td>
<td>


Per user namespace limits

</td>
</tr>
<tr>
<td>


vm/

</td>
<td>


memory management tuning buffer and cache management

</td>
</tr>
<tr>
<td>


xen/

</td>
<td>


&lt;undocumented&gt;

</td>
</tr>
</tbody>
</table>

These are the subdirs I have on my system or have been discovered by searching through the source code. There might be more or other subdirs in another setup. If you see another dir, I'd really like to hear about it :-)

- [Documentation for /proc/sys/abi/](</kernel/administration/admin-guide/sysctl/abi.md>)
- [Documentation for /proc/sys/fs/](</kernel/administration/admin-guide/sysctl/fs.md>)
- [Documentation for /proc/sys/kernel/](</kernel/administration/admin-guide/sysctl/kernel.md>)
- [Documentation for /proc/sys/net/](</kernel/administration/admin-guide/sysctl/net.md>)
- [Documentation for /proc/sys/sunrpc/](</kernel/administration/admin-guide/sysctl/sunrpc.md>)
- [Documentation for /proc/sys/user/](</kernel/administration/admin-guide/sysctl/user.md>)
- [Documentation for /proc/sys/vm/](</kernel/administration/admin-guide/sysctl/vm.md>)

---

# Documentation for /proc/sys/abi/

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> Copyright (c) 2020, Stephen Kitt

<a id="rst-documentation-for-proc-sys-abi"></a>

<!-- SPDX-License-Identifier: GPL-2.0+ -->

<!-- See scripts/check-sysctl-docs to keep this up to date: -->

<!-- scripts/check-sysctl-docs -vtable="abi" \ -->

<!-- Documentation/admin-guide/sysctl/abi.rst \ -->

<!-- $(git grep -l register_sysctl_) -->

Copyright (c) 2020, Stephen Kitt

For general info, see [Documentation/admin-guide/sysctl/index.rst](/kernel/administration/admin-guide/sysctl/index.md).

---

The files in `/proc/sys/abi` can be used to see and modify ABI-related settings.

Currently, these files might (depending on your configuration) show up in `/proc/sys/kernel`:

<a id="rst-contents"></a>



<a id="rst-vsyscall32-x86"></a>

## vsyscall32 (x86)

Determines whether the kernels maps a vDSO page into 32-bit processes; can be set to 1 to enable, or 0 to disable. Defaults to enabled if `CONFIG_COMPAT_VDSO` is set, disabled otherwise.

This controls the same setting as the `vdso32` kernel boot parameter.

---

# Documentation for /proc/sys/fs/

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> Filesystem sysctl behavior and its relationship to Peios authorization.

> **Peios:** Linux capability names in this interface retain their API meaning, but KACS evaluates them through native token privileges or compatibility rules. UID 0, `setcap` and Unix mode bits do not independently grant native authority. Object access and PIP checks remain additional constraints where applicable. See [Peios kernel behaviour](</kernel/introduction/peios-behaviour.md>) for the mapping and exceptions.


<a id="rst-documentation-for-proc-sys-fs"></a>

Copyright (c) 1998, 1999,  Rik van Riel &lt;[riel@nl.linux.org](<mailto:riel@nl.linux.org>)&gt;

Copyright (c) 2009,        Shen Feng&lt;[shen@cn.fujitsu.com](<mailto:shen@cn.fujitsu.com>)&gt;

For general info and legal blurb, please look in intro.rst.

---

This file contains documentation for the sysctl files and directories in `/proc/sys/fs/`.

The files in this directory can be used to tune and monitor miscellaneous and general things in the operation of the Linux kernel. Since some of the files *can* be used to screw up your system, it is advisable to read both documentation and source before actually making adjustments.

<a id="rst-proc-sys-fs"></a>

## 1. /proc/sys/fs

Currently, these files might (depending on your configuration) show up in `/proc/sys/fs`:

<a id="rst-contents"></a>



<a id="rst-aio-nr-aio-max-nr"></a>

### aio-nr &amp; aio-max-nr

`aio-nr` shows the current system-wide number of asynchronous io requests.  `aio-max-nr` allows you to change the maximum value `aio-nr` can grow to.  If `aio-nr` reaches `aio-nr-max` then `io_setup` will fail with `EAGAIN`.  Note that raising `aio-max-nr` does not result in the pre-allocation or re-sizing of any kernel data structures.

<a id="rst-dentry-negative"></a>

### dentry-negative

Policy for negative dentries. Set to 1 to always delete the dentry when a file is removed, and 0 to disable it. By default, this behavior is disabled.

<a id="rst-dentry-state"></a>

### dentry-state

This file shows the values in `struct dentry_stat_t`, as defined in `fs/dcache.c`:



```text
struct dentry_stat_t dentry_stat {
      long nr_dentry;
      long nr_unused;
      long age_limit;         /* age in seconds */
      long want_pages;        /* pages requested by system */
      long nr_negative;       /* # of unused negative dentries */
      long dummy;             /* Reserved for future use */
};
```

Dentries are dynamically allocated and deallocated.

`nr_dentry` shows the total number of dentries allocated (active + unused). `nr_unused shows` the number of dentries that are not actively used, but are saved in the LRU list for future reuse.

`age_limit` is the age in seconds after which dcache entries can be reclaimed when memory is short and `want_pages` is nonzero when `shrink_dcache_pages()` has been called and the dcache isn't pruned yet.

`nr_negative` shows the number of unused dentries that are also negative dentries which do not map to any files. Instead, they help speeding up rejection of non-existing files provided by the users.

<a id="rst-file-max-file-nr"></a>

### file-max &amp; file-nr

The value in `file-max` denotes the maximum number of file- handles that the Linux kernel will allocate. When you get lots of error messages about running out of file handles, you might want to increase this limit.

Historically,the kernel was able to allocate file handles dynamically, but not to free them again. The three values in `file-nr` denote the number of allocated file handles, the number of allocated but unused file handles, and the maximum number of file handles. Linux 2.6 and later always reports 0 as the number of free file handles -- this is not an error, it just means that the number of allocated file handles exactly matches the number of used file handles.

Attempts to allocate more file descriptors than `file-max` are reported with `printk`, look for:



```text
VFS: file-max limit <number> reached
```

in the kernel logs.

<a id="rst-inode-nr-inode-state"></a>

### inode-nr &amp; inode-state

The kernel allocates and reclaims inode structures dynamically. `inode-nr`
reports the number allocated and the number unused. `inode-state` exposes
the same first two counters followed by five compatibility fields, currently
zero. The unused counter describes cached unused inodes, not a fixed pool
that the kernel cannot free. Both interfaces are read-only.

<a id="rst-mount-max"></a>

### mount-max

This denotes the maximum number of mounts that may exist in a mount namespace.

<a id="rst-nr-open"></a>

### nr_open

This denotes the maximum number of file-handles a process can allocate. Default value is 1024\*1024 (1048576) which should be enough for most machines. Actual limit depends on `RLIMIT_NOFILE` resource limit.

<a id="rst-overflowgid-overflowuid"></a>

### overflowgid &amp; overflowuid

Some filesystems only support 16-bit UIDs and GIDs, although in Linux UIDs and GIDs are 32 bits. When one of these filesystems is mounted with writes enabled, any UID or GID that would exceed 65535 is translated to a fixed value before being written to disk.

These sysctls allow you to change the value of the fixed UID and GID. The default is 65534.

<a id="rst-pipe-user-pages-hard"></a>

### pipe-user-pages-hard

Maximum total number of pages a non-privileged user may allocate for pipes. Once this limit is reached, no new pipes may be allocated until usage goes below the limit again. When set to 0, no limit is applied, which is the default setting.

<a id="rst-pipe-user-pages-soft"></a>

### pipe-user-pages-soft

Maximum total number of pages a non-privileged user may allocate for pipes before the pipe size gets limited to two pages. Once this limit is reached, new pipes will be limited to two pages in size for this user in order to limit total memory usage, and trying to increase them using `fcntl()` will be denied until usage goes below the limit again. The default value allows to allocate up to 1024 pipes at their default size. When set to 0, no limit is applied.

<a id="rst-protected-fifos"></a>

### protected_fifos

The intent of this protection is to avoid unintentional writes to an attacker-controlled FIFO, where a program expected to create a regular file.

When set to "0", this extra FIFO protection is disabled; ordinary file and native access checks still apply.

When set to "1" don't allow `O_CREAT` open on FIFOs that we don't own in world writable sticky directories, unless they are owned by the owner of the directory.

When set to "2" it also applies to group writable sticky directories.

This protection is based on the restrictions in Openwall.

<a id="rst-protected-hardlinks"></a>

### protected_hardlinks

This controls the inherited extra hardlink-source check in `may_linkat()`.
Zero disables that extra check; it does not disable filesystem or KACS
authorization. With one, the upstream check admits a safe source or an inode
owner/capable caller. `CAP_FOWNER` is a compatibility-allow check in Peios, so
this sysctl is not an independent native boundary against such callers.
Native link and directory-access checks still apply. Invalid inode ID mappings
can also prevent linking.

<a id="rst-protected-regular"></a>

### protected_regular

This protection is similar to [protected_fifos](<#rst-protected-fifos>), but it avoids writes to an attacker-controlled regular file, where a program expected to create one.

When set to "0", this extra regular-file protection is disabled; ordinary file and native access checks still apply.

When set to "1" don't allow `O_CREAT` open on regular files that we don't own in world writable sticky directories, unless they are owned by the owner of the directory.

When set to "2" it also applies to group writable sticky directories.

<a id="rst-protected-symlinks"></a>

### protected_symlinks

A long-standing class of security issues is the symlink-based time-of-check-time-of-use race, most commonly seen in world-writable directories like `/tmp`. The common method of exploitation of this flaw is to cross privilege boundaries when following a given symlink (i.e. a root process follows a symlink belonging to another user). For a likely incomplete list of hundreds of examples across the years, please see: [https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=/tmp](<https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=/tmp>)

When set to "0", this extra symlink-following protection is disabled; other path and native access checks still apply.

When set to "1" symlinks are permitted to be followed only when outside a sticky world-writable directory, or when the uid of the symlink and follower match, or when the directory owner matches the symlink's owner.

This protection is based on the restrictions in Openwall and grsecurity.

<a id="rst-suid-dumpable"></a>

### suid_dumpable

This value can be used to query and set the core dump mode for setuid or otherwise protected/tainted binaries. The modes are


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


(default)

</td>
<td>


Traditional behaviour. Any process which has changed privilege levels or is execute only will not be dumped.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


(debug)

</td>
<td>


This debugging mode allows otherwise protected processes to dump core when possible, with the dump owned by the current Unix user. It can expose sensitive process memory through the resulting dump. In Peios it does not disable KACS process-access or PIP checks, and protected processes cannot use `PR_SET_DUMPABLE` to become ordinarily dumpable. Access to the dump file is also subject to native filesystem policy.

</td>
</tr>
<tr>
<td>


2

</td>
<td>


(suidsafe)

</td>
<td>


For a process whose dumpability is set to this mode, a dump is permitted only if the `core_pattern` kernel sysctl (see [Documentation/admin-guide/sysctl/kernel.rst](</kernel/administration/admin-guide/sysctl/kernel.md#rst-core-pattern-1>)) is set to either a pipe handler or a fully qualified path. (For more details on this limitation, see CVE-2006-2451.) This mode is appropriate when administrators are attempting to debug problems in a normal environment, and either have a core dump pipe handler that knows to treat privileged core dumps with care, or specific directory defined for catching core dumps. If a core dump happens without a pipe handler or fully qualified path, a message will be emitted to syslog warning about the lack of a correct setting.

</td>
</tr>
</tbody>
</table>

<a id="rst-proc-sys-fs-binfmt-misc"></a>

## 2. /proc/sys/fs/binfmt_misc

Documentation for the files in `/proc/sys/fs/binfmt_misc` is in [Documentation/admin-guide/binfmt-misc.rst](/kernel/administration/admin-guide/compatibility/binfmt-misc.md).

<a id="rst-proc-sys-fs-mqueue-posix-message-queues-filesystem"></a>

## 3. /proc/sys/fs/mqueue - POSIX message queues filesystem

The "mqueue"  filesystem provides  the necessary kernel features to enable the creation of a  user space  library that  implements  the  POSIX message queues API (as noted by the  MSG tag in the  POSIX 1003.1-2001 version  of the System Interfaces specification.)

The "mqueue" filesystem contains values for determining/setting the amount of resources used by the file system.

`/proc/sys/fs/mqueue/queues_max` is a read/write file for setting/getting the maximum number of message queues allowed on the system.

`/proc/sys/fs/mqueue/msg_max` is a read/write file for setting/getting the maximum number of messages in a queue value.  In fact it is the limiting value for another (user) limit which is set in `mq_open` invocation.  This attribute of a queue must be less than or equal to `msg_max`.

`/proc/sys/fs/mqueue/msgsize_max` is a read/write file for setting/getting the maximum message size value (it is an attribute of every message queue, set during its creation).

`/proc/sys/fs/mqueue/msg_default` is a read/write file for setting/getting the default number of messages in a queue value if the `attr` parameter of `mq_open(2)` is `NULL`. If it exceeds `msg_max`, the default value is initialized to `msg_max`.

`/proc/sys/fs/mqueue/msgsize_default` is a read/write file for setting/getting the default message size value if the `attr` parameter of `mq_open(2)` is `NULL`. If it exceeds `msgsize_max`, the default value is initialized to `msgsize_max`.

<a id="rst-proc-sys-fs-epoll-configuration-options-for-the-epoll-interface"></a>

## 4. /proc/sys/fs/epoll - Configuration options for the epoll interface

This directory contains configuration options for the epoll(7) interface.

<a id="rst-max-user-watches"></a>

### max_user_watches

Every epoll file descriptor can store a number of files to be monitored for event readiness. Each one of these monitored files constitutes a "watch". This configuration option sets the maximum number of "watches" that are allowed for each user. Each "watch" costs roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes on a 64-bit one. The current default value for `max_user_watches` is 4% of the available low memory, divided by the "watch" cost in bytes.

<a id="rst-proc-sys-fs-fuse-configuration-options-for-fuse-filesystems"></a>

## 5. /proc/sys/fs/fuse - Configuration options for FUSE filesystems

This directory contains the following configuration options for FUSE filesystems:

`/proc/sys/fs/fuse/max_pages_limit` is a read/write file for setting/getting the maximum number of pages that can be used for servicing requests in FUSE.

`/proc/sys/fs/fuse/default_request_timeout` is a read/write file for setting/getting the default timeout (in seconds) for a fuse server to reply to a kernel-issued request in the event where the server did not specify a timeout at mount. If the server set a timeout, then default_request_timeout will be ignored.  The default "default_request_timeout" is set to 0. 0 indicates no default timeout. The maximum value that can be set is 65535.

`/proc/sys/fs/fuse/max_request_timeout` is a read/write file for setting/getting the maximum timeout (in seconds) for a fuse server to reply to a kernel-issued request. A value greater than 0 automatically opts the server into a timeout that will be set to at most "max_request_timeout", even if the server did not specify a timeout and default_request_timeout is set to 0. If max_request_timeout is greater than 0 and the server set a timeout greater than max_request_timeout or default_request_timeout is set to a value greater than max_request_timeout, the system will use max_request_timeout as the timeout. 0 indicates no max request timeout. The maximum value that can be set is 65535.

For timeouts, if the server does not respond to the request by the time the set timeout elapses, then the connection to the fuse server will be aborted. Please note that the timeouts are not 100% precise (eg you may set 60 seconds but the timeout may kick in after 70 seconds). The upper margin of error for the timeout is roughly FUSE_TIMEOUT_TIMER_FREQ seconds.

---

# Documentation for /proc/sys/kernel/

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> Copyright (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>

> **Peios:** Linux capability names in this interface retain their API meaning, but KACS evaluates them through native token privileges or compatibility rules. UID 0, `setcap` and Unix mode bits do not independently grant native authority. Object access and PIP checks remain additional constraints where applicable. See [Peios kernel behaviour](</kernel/introduction/peios-behaviour.md>) for the mapping and exceptions.


<a id="rst-documentation-for-proc-sys-kernel"></a>

<!-- See scripts/check-sysctl-docs to keep this up to date -->

Copyright (c) 1998, 1999,  Rik van Riel &lt;[riel@nl.linux.org](<mailto:riel@nl.linux.org>)&gt;

Copyright (c) 2009,        Shen Feng&lt;[shen@cn.fujitsu.com](<mailto:shen@cn.fujitsu.com>)&gt;

For general info and legal blurb, please look in [Documentation/admin-guide/sysctl/index.rst](/kernel/administration/admin-guide/sysctl/index.md).

---

This file contains documentation for the sysctl files in `/proc/sys/kernel/`.

The files in this directory can be used to tune and monitor miscellaneous and general things in the operation of the Linux kernel. Since some of the files *can* be used to screw up your system, it is advisable to read both documentation and source before actually making adjustments.

Currently, these files might (depending on your configuration) show up in `/proc/sys/kernel`:

<a id="rst-contents"></a>



<a id="rst-acct"></a>

## acct



```text
highwater lowwater frequency
```

If BSD-style process accounting is enabled these values control its behaviour. If free space on filesystem where the log lives goes below `lowwater`% accounting suspends. If free space gets above `highwater`% accounting resumes. `frequency` determines how often do we check the amount of free space (value is in seconds). Default:



```text
4 2 30
```

That is, suspend accounting if free space drops below 2%; resume it if it increases to at least 4%; consider information about amount of free space valid for 30 seconds.

<a id="rst-acpi-video-flags"></a>

## acpi_video_flags

See [Documentation/power/video.rst](/kernel/internals/power/video.md). This allows the video resume mode to be set, in a similar fashion to the `acpi_sleep` kernel parameter, by combining the following values:


<table>
<tbody>
<tr>
<td>


1

</td>
<td>


s3_bios

</td>
</tr>
<tr>
<td>


2

</td>
<td>


s3_mode

</td>
</tr>
<tr>
<td>


4

</td>
<td>


s3_beep

</td>
</tr>
</tbody>
</table>

<a id="rst-arch"></a>

## arch

The machine hardware name, the same output as `uname -m` (e.g. `x86_64` or `aarch64`).

<a id="rst-auto-msgmni"></a>

## auto_msgmni

This variable has no effect and may be removed in future kernel releases. Reading it always returns 0. Up to Linux 3.17, it enabled/disabled automatic recomputing of [msgmni](<#rst-msgmni>) upon memory add/remove or upon IPC namespace creation/removal. Echoing "1" into this file enabled msgmni automatic recomputing. Echoing "0" turned it off. The default value was 1.

<a id="rst-bootloader-type-x86-only"></a>

## bootloader_type (x86 only)

This gives the bootloader type number as indicated by the bootloader, shifted left by 4, and OR'd with the low four bits of the bootloader version.  The reason for this encoding is that this used to match the `type_of_loader` field in the kernel header; the encoding is kept for backwards compatibility.  That is, if the full bootloader type number is 0x15 and the full version number is 0x234, this file will contain the value 340 = 0x154.

See the `type_of_loader` and `ext_loader_type` fields in [Documentation/arch/x86/boot.rst](/kernel/hardware/arch/x86/boot.md) for additional information.

<a id="rst-bootloader-version-x86-only"></a>

## bootloader_version (x86 only)

The complete bootloader version number.  In the example above, this file will contain the value 564 = 0x234.

See the `type_of_loader` and `ext_loader_ver` fields in [Documentation/arch/x86/boot.rst](/kernel/hardware/arch/x86/boot.md) for additional information.

<a id="rst-bpf-stats-enabled"></a>

## bpf_stats_enabled

Controls whether the kernel should collect statistics on BPF programs (total time spent running, number of times run...). Enabling statistics causes a slight reduction in performance on each program run. The statistics can be seen using `bpftool`.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Don't collect statistics (default).

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Collect statistics.

</td>
</tr>
</tbody>
</table>

<a id="rst-cad-pid"></a>

## cad_pid

This is the pid which will be signalled on reboot (notably, by Ctrl-Alt-Delete). Writing a value to this file which doesn't correspond to a running process will result in `-ESRCH`.

See also [ctrl-alt-del](<#rst-ctrl-alt-del>).

<a id="rst-cap-last-cap"></a>

## cap_last_cap

Highest valid capability of the running kernel.  Exports `CAP_LAST_CAP` from the kernel.

<a id="rst-core-pattern-1"></a>
<a id="rst-core-pattern"></a>

## core_pattern

`core_pattern` is used to specify a core dumpfile pattern name.

- max length 127 characters; default value is "core"

- `core_pattern` is used as a pattern template for the output filename; certain string patterns (beginning with '%') are substituted with their actual values.

- backward compatibility with `core_uses_pid`:

  > If `core_pattern` does not include "%p" (default does not) and `core_uses_pid` is set, then .PID will be appended to the filename.

- corename format specifiers

  >
  > <table>
  > <tbody>
  > <tr>
  > <td>
  >
  >
  > %&lt;NUL&gt;
  >
  > </td>
  > <td>
  >
  >
  > '%' is dropped
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %%
  >
  > </td>
  > <td>
  >
  >
  > output one '%'
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %p
  >
  > </td>
  > <td>
  >
  >
  > pid
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %P
  >
  > </td>
  > <td>
  >
  >
  > global pid (init PID namespace)
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %i
  >
  > </td>
  > <td>
  >
  >
  > tid
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %I
  >
  > </td>
  > <td>
  >
  >
  > global tid (init PID namespace)
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %u
  >
  > </td>
  > <td>
  >
  >
  > uid (in initial user namespace)
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %g
  >
  > </td>
  > <td>
  >
  >
  > gid (in initial user namespace)
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %d
  >
  > </td>
  > <td>
  >
  >
  > dump mode, matches `PR_SET_DUMPABLE` and `/proc/sys/fs/suid_dumpable`
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %s
  >
  > </td>
  > <td>
  >
  >
  > signal number
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %t
  >
  > </td>
  > <td>
  >
  >
  > UNIX time of dump
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %h
  >
  > </td>
  > <td>
  >
  >
  > hostname
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %e
  >
  > </td>
  > <td>
  >
  >
  > executable filename (may be shortened, could be changed by prctl etc)
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %f
  >
  > </td>
  > <td>
  >
  >
  > executable filename
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %E
  >
  > </td>
  > <td>
  >
  >
  > executable path
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %c
  >
  > </td>
  > <td>
  >
  >
  > maximum size of core file by resource limit RLIMIT_CORE
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %C
  >
  > </td>
  > <td>
  >
  >
  > CPU the task ran on
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %F
  >
  > </td>
  > <td>
  >
  >
  > pidfd number
  >
  > </td>
  > </tr>
  > <tr>
  > <td>
  >
  >
  > %&lt;OTHER&gt;
  >
  > </td>
  > <td>
  >
  >
  > both are dropped
  >
  > </td>
  > </tr>
  > </tbody>
  > </table>

- If the first character of the pattern is a '\|', the kernel will treat the rest of the pattern as a command to run.  The core dump will be written to the standard input of that program instead of to a file.

<a id="rst-core-pipe-limit"></a>

## core_pipe_limit

This sysctl is only applicable when [core_pattern](<#rst-core-pattern>) is configured to pipe core files to a user space helper (when the first character of `core_pattern` is a '\|', see above). When collecting cores via a pipe to an application, it is occasionally useful for the collecting application to gather data about the crashing process from its `/proc/pid` directory. In order to do this safely, the kernel must wait for the collecting process to exit, so as not to remove the crashing processes proc files prematurely. This in turn creates the possibility that a misbehaving userspace collecting process can block the reaping of a crashed process simply by never exiting. This sysctl defends against that. It defines how many concurrent crashing processes may be piped to user space applications in parallel. If this value is exceeded, then those crashing processes above that value are noted via the kernel log and their cores are skipped. 0 is a special value, indicating that unlimited processes may be captured in parallel, but that no waiting will take place (i.e. the collecting process is not guaranteed access to `/proc/<crashing pid>/`). This value defaults to 0.

<a id="rst-core-sort-vma"></a>

## core_sort_vma

The default coredump writes VMAs in address order. By setting `core_sort_vma` to 1, VMAs will be written from smallest size to largest size. This is known to break at least elfutils, but can be handy when dealing with very large (and truncated) coredumps where the more useful debugging details are included in the smaller VMAs.

<a id="rst-core-uses-pid"></a>

## core_uses_pid

The default coredump filename is "core".  By setting `core_uses_pid` to 1, the coredump filename becomes core.PID. If [core_pattern](<#rst-core-pattern>) does not include "%p" (default does not) and `core_uses_pid` is set, then .PID will be appended to the filename.

<a id="rst-ctrl-alt-del"></a>

## ctrl-alt-del

When the value in this file is 0, ctrl-alt-del is trapped and sent to the `init(1)` program to handle a graceful restart. When, however, the value is &gt; 0, Linux's reaction to a Vulcan Nerve Pinch (tm) will be an immediate reboot, without even syncing its dirty buffers.

- **Note:**

  when a program (like dosemu) has the keyboard in 'raw' mode, the ctrl-alt-del is intercepted by the program before it ever reaches the kernel tty layer, and it's up to the program to decide what to do with it.

<a id="rst-dmesg-restrict"></a>

## dmesg_restrict

This toggle indicates whether unprivileged users are prevented from using `dmesg(8)` to view messages from the kernel's log buffer. When `dmesg_restrict` is set to 0 there are no restrictions. When `dmesg_restrict` is set to 1, users must have `CAP_SYSLOG` to use `dmesg(8)`.

The kernel config option `CONFIG_SECURITY_DMESG_RESTRICT` sets the default value of `dmesg_restrict`.

<a id="rst-domainname-hostname"></a>

## domainname &amp; hostname

These files can be used to set the NIS/YP domainname and the hostname of your box in exactly the same way as the commands domainname and hostname, i.e.:



```text
# echo "darkstar" > /proc/sys/kernel/hostname
# echo "mydomain" > /proc/sys/kernel/domainname
```

has the same effect as:



```text
# hostname "darkstar"
# domainname "mydomain"
```

Note, however, that the classic darkstar.frop.org has the hostname "darkstar" and DNS (Internet Domain Name Server) domainname "frop.org", not to be confused with the NIS (Network Information Service) or YP (Yellow Pages) domainname. These two domain names are in general different. For a detailed discussion see the `hostname(1)` man page.

<a id="rst-firmware-config"></a>

## firmware_config

See [Documentation/driver-api/firmware/fallback-mechanisms.rst](/kernel/hardware/driver-api/firmware/fallback-mechanisms.md).

The entries in this directory allow the firmware loader helper fallback to be controlled:

- `force_sysfs_fallback`, when set to 1, forces the use of the fallback;

- `ignore_sysfs_fallback`, when set to 1, ignores any fallback.

<a id="rst-ftrace-dump-on-oops"></a>

## ftrace_dump_on_oops

Determines whether `ftrace_dump()` should be called on an oops (or kernel panic). This will output the contents of the ftrace buffers to the console.  This is very useful for capturing traces that lead to crashes and outputting them to a serial console.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Disabled (default).

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Dump buffers of all CPUs.

</td>
</tr>
<tr>
<td>


2(orig_cpu)

</td>
<td>


Dump the buffer of the CPU that triggered the oops.

</td>
</tr>
<tr>
<td>


&lt;instance&gt;

</td>
<td>


Dump the specific instance buffer on all CPUs.

</td>
</tr>
<tr>
<td>


&lt;instance&gt;=2(orig_cpu)

</td>
<td>


Dump the specific instance buffer on the CPU that triggered the oops.

</td>
</tr>
</tbody>
</table>

Multiple instance dump is also supported, and instances are separated by commas. If global buffer also needs to be dumped, please specify the dump mode (1/2/orig_cpu) first for global buffer.

So for example to dump "foo" and "bar" instance buffer on all CPUs, user can:



```text
echo "foo,bar" > /proc/sys/kernel/ftrace_dump_on_oops
```

To dump global buffer and "foo" instance buffer on all CPUs along with the "bar" instance buffer on CPU that triggered the oops, user can:



```text
echo "1,foo,bar=2" > /proc/sys/kernel/ftrace_dump_on_oops
```

<a id="rst-ftrace-enabled-stack-tracer-enabled"></a>

## ftrace_enabled, stack_tracer_enabled

See [Documentation/trace/ftrace.rst](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/trace/ftrace.rst?id=9021cc14f7d98b4a1d2c932f52c5343d4d0f6b92).

<a id="rst-hardlockup-all-cpu-backtrace"></a>

## hardlockup_all_cpu_backtrace

This value controls the hard lockup detector behavior when a hard lockup condition is detected as to whether or not to gather further debug information. If enabled, arch-specific all-CPU stack dumping will be initiated.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Do nothing. This is the default behavior.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


On detection capture more debug information.

</td>
</tr>
</tbody>
</table>

<a id="rst-hardlockup-panic"></a>

## hardlockup_panic

This parameter can be used to control whether the kernel panics when a hard lockup is detected.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Don't panic on hard lockup.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Panic on hard lockup.

</td>
</tr>
</tbody>
</table>

See [Documentation/admin-guide/lockup-watchdogs.rst](/kernel/administration/admin-guide/diagnostics/lockup-watchdogs.md) for more information. This can also be set using the nmi_watchdog kernel parameter.

<a id="rst-hotplug"></a>

## hotplug

Path for the hotplug policy agent. Default value is `CONFIG_UEVENT_HELPER_PATH`, which in turn defaults to the empty string.

This file only exists when `CONFIG_UEVENT_HELPER` is enabled. Most modern systems rely exclusively on the netlink-based uevent source and don't need this.

<a id="rst-hung-task-all-cpu-backtrace"></a>

## hung_task_all_cpu_backtrace

If this option is set, the kernel will send an NMI to all CPUs to dump their backtraces when a hung task is detected. This file shows up if CONFIG_DETECT_HUNG_TASK and CONFIG_SMP are enabled.

0: Won't show all CPUs backtraces when a hung task is detected. This is the default behavior.

1: Will non-maskably interrupt all CPUs and dump their backtraces when a hung task is detected.

<a id="rst-hung-task-panic"></a>

## hung_task_panic

When set to a non-zero value, a kernel panic will be triggered if the number of hung tasks found during a single scan reaches this value. This file shows up if `CONFIG_DETECT_HUNG_TASK` is enabled.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Continue operation. This is the default behavior.

</td>
</tr>
<tr>
<td>


N

</td>
<td>


Panic when N hung tasks are found during a single scan.

</td>
</tr>
</tbody>
</table>

<a id="rst-hung-task-check-count"></a>

## hung_task_check_count

The upper bound on the number of tasks that are checked. This file shows up if `CONFIG_DETECT_HUNG_TASK` is enabled.

<a id="rst-hung-task-detect-count"></a>

## hung_task_detect_count

Indicates the total number of tasks that have been detected as hung since the system boot.

This file shows up if `CONFIG_DETECT_HUNG_TASK` is enabled.

<a id="rst-hung-task-sys-info"></a>

## hung_task_sys_info

A comma separated list of extra system information to be dumped when hung task is detected, for example, "tasks,mem,timers,locks,...". Refer 'panic_sys_info' section below for more details.

<a id="rst-hung-task-timeout-secs"></a>

## hung_task_timeout_secs

When a task in D state did not get scheduled for more than this value report a warning. This file shows up if `CONFIG_DETECT_HUNG_TASK` is enabled.

0 means infinite timeout, no checking is done.

Possible values to set are in range \{0:`LONG_MAX`/`HZ`\}.

<a id="rst-hung-task-check-interval-secs"></a>

## hung_task_check_interval_secs

Hung task check interval. If hung task checking is enabled (see [hung_task_timeout_secs](<#rst-hung-task-timeout-secs>)), the check is done every `hung_task_check_interval_secs` seconds. This file shows up if `CONFIG_DETECT_HUNG_TASK` is enabled.

0 (default) means use `hung_task_timeout_secs` as checking interval.

Possible values to set are in range \{0:`LONG_MAX`/`HZ`\}.

<a id="rst-hung-task-warnings"></a>

## hung_task_warnings

The maximum number of warnings to report. During a check interval if a hung task is detected, this value is decreased by 1. When this value reaches 0, no more warnings will be reported. This file shows up if `CONFIG_DETECT_HUNG_TASK` is enabled.

-1: report an infinite number of warnings.

<a id="rst-hyperv-record-panic-msg"></a>

## hyperv_record_panic_msg

Controls whether the panic kmsg data should be reported to Hyper-V.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Do not report panic kmsg data.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Report the panic kmsg data. This is the default behavior.

</td>
</tr>
</tbody>
</table>

<a id="rst-ignore-unaligned-usertrap"></a>

## ignore-unaligned-usertrap

On architectures where unaligned accesses cause traps, and where this feature is supported (`CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN`; currently, `arc`, `parisc` and `loongarch`), controls whether all unaligned traps are logged.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Log all unaligned accesses.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Only warn the first time a process traps. This is the default setting.

</td>
</tr>
</tbody>
</table>

See also [unaligned-trap](<#rst-unaligned-trap>).

<a id="rst-io-uring-disabled"></a>

## io_uring_disabled

Prevents all processes from creating new io_uring instances. Enabling this shrinks the kernel's attack surface.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


All processes can create io_uring instances as normal. This is the default setting.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


io_uring creation is disabled (io_uring_setup() will fail with -EPERM) for unprivileged processes not in the io_uring_group group. Existing io_uring instances can still be used.  See the documentation for io_uring_group for more information.

</td>
</tr>
<tr>
<td>


2

</td>
<td>


io_uring creation is disabled for all processes. io_uring_setup() always fails with -EPERM. Existing io_uring instances can still be used.

</td>
</tr>
</tbody>
</table>

<a id="rst-io-uring-group"></a>

## io_uring_group

When io_uring_disabled is set to 1, a process must either be privileged (CAP_SYS_ADMIN) or be in the io_uring_group group in order to create an io_uring instance.  If io_uring_group is set to -1 (the default), only processes with the CAP_SYS_ADMIN capability may create io_uring instances.

<a id="rst-kernel-sys-info"></a>

## kernel_sys_info

A comma separated list of extra system information to be dumped when soft/hard lockup is detected, for example, "tasks,mem,timers,locks,...". Refer 'panic_sys_info' section below for more details.

It serves as the default kernel control knob, which will take effect when a kernel module calls sys_info() with parameter==0.

<a id="rst-kexec-load-disabled"></a>

## kexec_load_disabled

A toggle indicating if the syscalls `kexec_load` and `kexec_file_load` have been disabled. This value defaults to 0 (false: `kexec_*load` enabled), but can be set to 1 (true: `kexec_*load` disabled). Once true, kexec can no longer be used, and the toggle cannot be set back to false. This allows a kexec image to be loaded before disabling the syscall, allowing a system to set up (and later use) an image without it being altered. Generally used together with the [modules_disabled](<#rst-modules-disabled>) sysctl.

<a id="rst-kexec-load-limit-panic"></a>

## kexec_load_limit_panic

This parameter specifies a limit to the number of times the syscalls `kexec_load` and `kexec_file_load` can be called with a crash image. It can only be set with a more restrictive value than the current one.


<table>
<tbody>
<tr>
<td>


-1

</td>
<td>


Unlimited calls to kexec. This is the default setting.

</td>
</tr>
<tr>
<td>


N

</td>
<td>


Number of calls left.

</td>
</tr>
</tbody>
</table>

<a id="rst-kexec-load-limit-reboot"></a>

## kexec_load_limit_reboot

Similar functionality as `kexec_load_limit_panic`, but for a normal image.

<a id="rst-kptr-restrict"></a>

## kptr_restrict

This toggle indicates whether restrictions are placed on exposing kernel addresses via `/proc` and other interfaces.

When `kptr_restrict` is set to 0 (the default) the address is hashed before printing. (This is the equivalent to %p.)

When `kptr_restrict` is set to 1, kernel pointers printed using the %pK format specifier will be replaced with 0s unless the user has `CAP_SYSLOG` and effective user and group ids are equal to the real ids. This is because %pK checks are done at read() time rather than open() time, so if permissions are elevated between the open() and the read() (e.g via a setuid binary) then %pK will not leak kernel pointers to unprivileged users. Note, this is a temporary solution only. The correct long-term solution is to do the permission checks at open() time. Consider removing world read permissions from files that use %pK, and using [dmesg_restrict](<#rst-dmesg-restrict>) to protect against uses of %pK in `dmesg(8)` if leaking kernel pointer values to unprivileged users is a concern.

When `kptr_restrict` is set to 2, kernel pointers printed using %pK will be replaced with 0s regardless of privileges.

For disabling these security restrictions early at boot time (and once for all), use the `hash_pointers` boot parameter instead.

<a id="rst-softlockup-sys-info-hardlockup-sys-info"></a>

## softlockup_sys_info &amp; hardlockup_sys_info

A comma separated list of extra system information to be dumped when soft/hard lockup is detected, for example, "tasks,mem,timers,locks,...". Refer 'panic_sys_info' section below for more details.

<a id="rst-modprobe"></a>

## modprobe

The full path to the usermode helper for autoloading kernel modules, by default `CONFIG_MODPROBE_PATH`, which Peios configures as `/bin/modprobe`.  This binary is executed when the kernel requests a module.  For example, if userspace passes an unknown filesystem type to mount(), then the kernel will automatically request the corresponding filesystem module by executing this usermode helper. This usermode helper should insert the needed module into the kernel.

This sysctl only affects module autoloading.  It has no effect on the ability to explicitly insert modules.

Peios requires kernel-initiated usermode helpers to execute with at least `PeiosTcb` trust. An arbitrary logging shell script substituted through this sysctl is therefore not a valid helper. Keep the configured, appropriately signed helper and use the available module-request tracing facilities to diagnose autoloading.

Alternatively, if this sysctl is set to the empty string, then module autoloading is completely disabled.  The kernel will not try to execute a usermode helper at all, nor will it call the kernel_module_request LSM hook.

If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration, then the configured static usermode helper overrides this sysctl, except that the empty string is still accepted to completely disable module autoloading as described above.

<a id="rst-modules-disabled"></a>

## modules_disabled

A toggle value indicating if modules are allowed to be loaded in an otherwise modular kernel.  This toggle defaults to off (0), but can be set true (1).  Once true, modules can be neither loaded nor unloaded, and the toggle cannot be set back to false.  Generally used with the [kexec_load_disabled](<#rst-kexec-load-disabled>) toggle.

<a id="rst-msgmax-msgmnb-and-msgmni"></a>
<a id="rst-msgmni"></a>

## msgmax, msgmnb, and msgmni

`msgmax` is the maximum size of an IPC message, in bytes. 8192 by default (`MSGMAX`).

`msgmnb` is the maximum size of an IPC queue, in bytes. 16384 by default (`MSGMNB`).

`msgmni` is the maximum number of IPC queues. 32000 by default (`MSGMNI`).

All of these parameters are set per ipc namespace. The maximum number of bytes in POSIX message queues is limited by `RLIMIT_MSGQUEUE`. This limit is respected hierarchically in the each user namespace.

<a id="rst-msg-next-id-sem-next-id-and-shm-next-id-system-v-ipc"></a>

## msg_next_id, sem_next_id, and shm_next_id (System V IPC)

These three toggles allows to specify desired id for next allocated IPC object: message, semaphore or shared memory respectively.

By default they are equal to -1, which means generic allocation logic. Possible values to set are in range \{0:`INT_MAX`\}.

- **Notes:**

  1. kernel doesn't guarantee, that new object will have desired id. So, it's up to userspace, how to handle an object with "wrong" id.

  2. Toggle with non-default value will be set back to -1 by kernel after successful IPC object allocation. If an IPC object allocation syscall fails, it is undefined if the value remains unmodified or is reset to -1.

<a id="rst-ngroups-max"></a>

## ngroups_max

Maximum number of supplementary groups, \_i.e.\_ the maximum size which `setgroups` will accept. Exports `NGROUPS_MAX` from the kernel.

<a id="rst-nmi-watchdog"></a>

## nmi_watchdog

This parameter can be used to control the NMI watchdog (i.e. the hard lockup detector) on x86 systems.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Disable the hard lockup detector.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Enable the hard lockup detector.

</td>
</tr>
</tbody>
</table>

The hard lockup detector monitors each CPU for its ability to respond to timer interrupts. The mechanism utilizes CPU performance counter registers that are programmed to generate Non-Maskable Interrupts (NMIs) periodically while a CPU is busy. Hence, the alternative name 'NMI watchdog'.

The NMI watchdog is disabled by default if the kernel is running as a guest in a KVM virtual machine. This default can be overridden by adding:



```text
nmi_watchdog=1
```

to the guest kernel command line (see [Documentation/admin-guide/kernel-parameters.rst](/kernel/administration/admin-guide/boot/kernel-parameters.md)).

<a id="rst-nmi-wd-lpm-factor-ppc-only"></a>

## nmi_wd_lpm_factor (PPC only)

Factor to apply to the NMI watchdog timeout (only when `nmi_watchdog` is set to 1). This factor represents the percentage added to `watchdog_thresh` when calculating the NMI watchdog timeout during an LPM. The soft lockup timeout is not impacted.

A value of 0 means no change. The default value is 200 meaning the NMI watchdog is set to 30s (based on `watchdog_thresh` equal to 10).

<a id="rst-numa-balancing"></a>

## numa_balancing

Enables/disables and configures automatic page fault based NUMA memory balancing.  Memory is moved automatically to nodes that access it often. The value to set can be the result of ORing the following:


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


NUMA_BALANCING_DISABLED

</td>
</tr>
<tr>
<td>


1

</td>
<td>


NUMA_BALANCING_NORMAL

</td>
</tr>
<tr>
<td>


2

</td>
<td>


NUMA_BALANCING_MEMORY_TIERING

</td>
</tr>
</tbody>
</table>

Or NUMA_BALANCING_NORMAL to optimize page placement among different NUMA nodes to reduce remote accessing.  On NUMA machines, there is a performance penalty if remote memory is accessed by a CPU. When this feature is enabled the kernel samples what task thread is accessing memory by periodically unmapping pages and later trapping a page fault. At the time of the page fault, it is determined if the data being accessed should be migrated to a local memory node.

The unmapping of pages and trapping faults incur additional overhead that ideally is offset by improved memory locality but there is no universal guarantee. If the target workload is already bound to NUMA nodes then this feature should be disabled.

Or NUMA_BALANCING_MEMORY_TIERING to optimize page placement among different types of memory (represented as different NUMA nodes) to place the hot pages in the fast memory.  This is implemented based on unmapping and page fault too.

<a id="rst-numa-balancing-promote-rate-limit-mbps"></a>

## numa_balancing_promote_rate_limit_MBps

Too high promotion/demotion throughput between different memory types may hurt application latency.  This can be used to rate limit the promotion throughput.  The per-node max promotion throughput in MB/s will be limited to be no more than the set value.

A rule of thumb is to set this to less than 1/10 of the PMEM node write bandwidth.

<a id="rst-oops-all-cpu-backtrace"></a>

## oops_all_cpu_backtrace

If this option is set, the kernel will send an NMI to all CPUs to dump their backtraces when an oops event occurs. It should be used as a last resort in case a panic cannot be triggered (to protect VMs running, for example) or kdump can't be collected. This file shows up if CONFIG_SMP is enabled.

0: Won't show all CPUs backtraces when an oops is detected. This is the default behavior.

1: Will non-maskably interrupt all CPUs and dump their backtraces when an oops event is detected.

<a id="rst-oops-limit"></a>

## oops_limit

Number of kernel oopses after which the kernel should panic when `panic_on_oops` is not set. Setting this to 0 disables checking the count. Setting this to  1 has the same effect as setting `panic_on_oops=1`. The default value is 10000.

<a id="rst-osrelease-ostype-version"></a>

## osrelease, ostype &amp; version



```text
# cat osrelease
2.1.88
# cat ostype
Linux
# cat version
#5 Wed Feb 25 21:49:24 MET 1998
```

The files `osrelease` and `ostype` should be clear enough. `version` needs a little more clarification however. The '\#5' means that this is the fifth kernel built from this source base and the date behind it indicates the time the kernel was built. The only way to tune these values is to rebuild the kernel :-)

<a id="rst-overflowgid-overflowuid"></a>

## overflowgid &amp; overflowuid

if your architecture did not always support 32-bit UIDs (i.e. arm, i386, m68k, sh, and sparc32), a fixed UID and GID will be returned to applications that use the old 16-bit UID/GID system calls, if the actual UID or GID would exceed 65535.

These sysctls allow you to change the value of the fixed UID and GID. The default is 65534.

<a id="rst-panic"></a>

## panic

The value in this file determines the behaviour of the kernel on a panic:

- if zero, the kernel will loop forever;

- if negative, the kernel will reboot immediately;

- if positive, the kernel will reboot after the corresponding number of seconds.

When you use the software watchdog, the recommended setting is 60.

<a id="rst-panic-on-io-nmi"></a>

## panic_on_io_nmi

Controls the kernel's behavior when a CPU receives an NMI caused by an IO error.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Try to continue operation (default).

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Panic immediately. The IO error triggered an NMI. This indicates a serious system condition which could result in IO data corruption. Rather than continuing, panicking might be a better choice. Some servers issue this sort of NMI when the dump button is pushed, and you can use this option to take a crash dump.

</td>
</tr>
</tbody>
</table>

<a id="rst-panic-on-oops"></a>

## panic_on_oops

Controls the kernel's behaviour when an oops or BUG is encountered.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Try to continue operation.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Panic immediately.  If the `panic` sysctl is also non-zero then the machine will be rebooted.

</td>
</tr>
</tbody>
</table>

<a id="rst-panic-on-stackoverflow"></a>

## panic_on_stackoverflow

Controls the kernel's behavior when detecting the overflows of kernel, IRQ and exception stacks except a user stack. This file shows up if `CONFIG_DEBUG_STACKOVERFLOW` is enabled.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Try to continue operation.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Panic immediately.

</td>
</tr>
</tbody>
</table>

<a id="rst-panic-on-unrecovered-nmi"></a>

## panic_on_unrecovered_nmi

The default Linux behaviour on an NMI of either memory or unknown is to continue operation. For many environments such as scientific computing it is preferable that the box is taken out and the error dealt with than an uncorrected parity/ECC error get propagated.

A small number of systems do generate NMIs for bizarre random reasons such as power management so the default is off. That sysctl works like the existing panic controls already in that directory.

<a id="rst-panic-on-warn"></a>

## panic_on_warn

Calls panic() in the WARN() path when set to 1.  This is useful to avoid a kernel rebuild when attempting to kdump at the location of a WARN().


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Only WARN(), default behaviour.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Call panic() after printing out WARN() location.

</td>
</tr>
</tbody>
</table>

<a id="rst-panic-print"></a>

## panic_print

Bitmask for printing system info when panic happens. User can chose combination of the following bits:


<table>
<tbody>
<tr>
<td>


bit 0

</td>
<td>


print all tasks info

</td>
</tr>
<tr>
<td>


bit 1

</td>
<td>


print system memory info

</td>
</tr>
<tr>
<td>


bit 2

</td>
<td>


print timer info

</td>
</tr>
<tr>
<td>


bit 3

</td>
<td>


print locks info if `CONFIG_LOCKDEP` is on

</td>
</tr>
<tr>
<td>


bit 4

</td>
<td>


print ftrace buffer

</td>
</tr>
<tr>
<td>


bit 5

</td>
<td>


replay all kernel messages on consoles at the end of panic

</td>
</tr>
<tr>
<td>


bit 6

</td>
<td>


print all CPUs backtrace (if available in the arch)

</td>
</tr>
<tr>
<td>


bit 7

</td>
<td>


print only tasks in uninterruptible (blocked) state

</td>
</tr>
</tbody>
</table>

So for example to print tasks and memory info on panic, user can:



```text
echo 3 > /proc/sys/kernel/panic_print
```

<a id="rst-panic-sys-info"></a>

## panic_sys_info

A comma separated list of extra information to be dumped on panic, for example, "tasks,mem,timers,...".  It is a human readable alternative to 'panic_print'. Possible values are:


<table>
<tbody>
<tr>
<td>


tasks

</td>
<td>


print all tasks info

</td>
</tr>
<tr>
<td>


mem

</td>
<td>


print system memory info

</td>
</tr>
<tr>
<td>


timers

</td>
<td>


print timers info

</td>
</tr>
<tr>
<td>


locks

</td>
<td>


print locks info if CONFIG_LOCKDEP is on

</td>
</tr>
<tr>
<td>


ftrace

</td>
<td>


print ftrace buffer

</td>
</tr>
<tr>
<td>


all_bt

</td>
<td>


print all CPUs backtrace (if available in the arch)

</td>
</tr>
<tr>
<td>


blocked_tasks

</td>
<td>


print only tasks in uninterruptible (blocked) state

</td>
</tr>
</tbody>
</table>

<a id="rst-panic-on-rcu-stall"></a>

## panic_on_rcu_stall

When set to 1, calls panic() after RCU stall detection messages. This is useful to define the root cause of RCU stalls using a vmcore.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Do not panic() when RCU stall takes place, default behavior.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


panic() after printing RCU stall messages.

</td>
</tr>
</tbody>
</table>

<a id="rst-max-rcu-stall-to-panic"></a>

## max_rcu_stall_to_panic

When `panic_on_rcu_stall` is set to 1, this value determines the number of times that RCU can stall before panic() is called.

When `panic_on_rcu_stall` is set to 0, this value is has no effect.

<a id="rst-perf-cpu-time-max-percent"></a>

## perf_cpu_time_max_percent

Hints to the kernel how much CPU time it should be allowed to use to handle perf sampling events.  If the perf subsystem is informed that its samples are exceeding this limit, it will drop its sampling frequency to attempt to reduce its CPU usage.

Some perf sampling happens in NMIs.  If these samples unexpectedly take too long to execute, the NMIs can become stacked up next to each other so much that nothing else is allowed to execute.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Disable the mechanism.  Do not monitor or correct perf's sampling rate no matter how CPU time it takes.

</td>
</tr>
<tr>
<td>


1-100

</td>
<td>


Attempt to throttle perf's sample rate to this percentage of CPU.  Note: the kernel calculates an "expected" length of each sample event.  100 here means 100% of that expected length.  Even if this is set to 100, you may still see sample throttling if this length is exceeded.  Set to 0 if you truly do not care how much CPU is consumed.

</td>
</tr>
</tbody>
</table>

<a id="rst-perf-event-paranoid"></a>

## perf_event_paranoid

Controls use of the performance events system by unprivileged users (without CAP_PERFMON).  The default value is 2.

For backward compatibility reasons access to system performance monitoring and observability remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure system performance monitoring and observability operations is discouraged with respect to CAP_PERFMON use cases.


<table>
<tbody>
<tr>
<td>


-1

</td>
<td>


Allow use of (almost) all events by all users.

Ignore mlock limit after perf_event_mlock_kb without `CAP_IPC_LOCK`.

</td>
</tr>
<tr>
<td>


&gt;=0

</td>
<td>


Disallow ftrace function tracepoint by users without `CAP_PERFMON`.

Disallow raw tracepoint access by users without `CAP_PERFMON`.

</td>
</tr>
<tr>
<td>


&gt;=1

</td>
<td>


Disallow CPU event access by users without `CAP_PERFMON`.

</td>
</tr>
<tr>
<td>


&gt;=2

</td>
<td>


Disallow kernel profiling by users without `CAP_PERFMON`.

</td>
</tr>
</tbody>
</table>

<a id="rst-perf-event-max-stack"></a>

## perf_event_max_stack

Controls maximum number of stack frames to copy for (`attr.sample_type & PERF_SAMPLE_CALLCHAIN`) configured events, for instance, when using '`perf record -g`' or '`perf trace --call-graph fp`'.

This can only be done when no events are in use that have callchains enabled, otherwise writing to this file will return `-EBUSY`.

The default value is 127.

<a id="rst-perf-event-mlock-kb"></a>

## perf_event_mlock_kb

Control size of per-cpu ring buffer not counted against mlock limit.

The default value is 512 + 1 page

<a id="rst-perf-event-max-contexts-per-stack"></a>

## perf_event_max_contexts_per_stack

Controls maximum number of stack frame context entries for (`attr.sample_type & PERF_SAMPLE_CALLCHAIN`) configured events, for instance, when using '`perf record -g`' or '`perf trace --call-graph fp`'.

This can only be done when no events are in use that have callchains enabled, otherwise writing to this file will return `-EBUSY`.

The default value is 8.

<a id="rst-perf-user-access-arm64-and-riscv-only"></a>

## perf_user_access (arm64 and riscv only)

Controls user space access for reading perf event counters.

- for arm64 The default value is 0 (access disabled).

  When set to 1, user space can read performance monitor counter registers directly.

  See [Documentation/arch/arm64/perf.rst](/kernel/hardware/arch/arm64/perf.md) for more information.

- for riscv When set to 0, user space access is disabled.

  The default value is 1, user space can read performance monitor counter registers through perf, any direct access without perf intervention will trigger an illegal instruction.

  When set to 2, which enables legacy mode (user space has direct access to cycle and insret CSRs only). Note that this legacy value is deprecated and will be removed once all user space applications are fixed.

  Note that the time CSR is always directly accessible to all modes.

<a id="rst-pid-max"></a>

## pid_max

PID allocation wrap value.  When the kernel's next PID value reaches this value, it wraps back to a minimum PID value. PIDs of value `pid_max` or larger are not allocated.

<a id="rst-ns-last-pid"></a>

## ns_last_pid

The last pid allocated in the current (the one task using this sysctl lives in) pid namespace. When selecting a pid for a next task on fork kernel tries to allocate a number starting from this one.

<a id="rst-powersave-nap-ppc-only"></a>

## powersave-nap (PPC only)

If set, Linux-PPC will use the 'nap' mode of powersaving, otherwise the 'doze' mode will be used.

---

<a id="rst-printk"></a>

## printk

The four values in printk denote: `console_loglevel`, `default_message_loglevel`, `minimum_console_loglevel` and `default_console_loglevel` respectively.

These values influence printk() behavior when printing or logging error messages. See '`man 2 syslog`' for more info on the different loglevels.


<table>
<tbody>
<tr>
<td>


console_loglevel

</td>
<td>


messages with a higher priority than this will be printed to the console

</td>
</tr>
<tr>
<td>


default_message_loglevel

</td>
<td>


messages without an explicit priority will be printed with this priority

</td>
</tr>
<tr>
<td>


minimum_console_loglevel

</td>
<td>


minimum (highest) value to which console_loglevel can be set

</td>
</tr>
<tr>
<td>


default_console_loglevel

</td>
<td>


default value for console_loglevel

</td>
</tr>
</tbody>
</table>

<a id="rst-printk-delay"></a>

## printk_delay

Delay each printk message in `printk_delay` milliseconds

Value from 0 - 10000 is allowed.

<a id="rst-printk-ratelimit"></a>

## printk_ratelimit

Some warning messages are rate limited. `printk_ratelimit` specifies the minimum length of time between these messages (in seconds). The default value is 5 seconds.

A value of 0 will disable rate limiting.

<a id="rst-printk-ratelimit-burst"></a>

## printk_ratelimit_burst

While long term we enforce one message per [printk_ratelimit](<#rst-printk-ratelimit>) seconds, we do allow a burst of messages to pass through. `printk_ratelimit_burst` specifies the number of messages we can send before ratelimiting kicks in.  After [printk_ratelimit](<#rst-printk-ratelimit>) seconds have elapsed, another burst of messages may be sent.

The default value is 10 messages.

<a id="rst-printk-devkmsg"></a>

## printk_devkmsg

Control the logging to `/dev/kmsg` from userspace:


<table>
<tbody>
<tr>
<td>


ratelimit

</td>
<td>


default, ratelimited

</td>
</tr>
<tr>
<td>


on

</td>
<td>


unlimited logging to /dev/kmsg from userspace

</td>
</tr>
<tr>
<td>


off

</td>
<td>


logging to /dev/kmsg disabled

</td>
</tr>
</tbody>
</table>

The kernel command line parameter `printk.devkmsg=` overrides this and is a one-time setting until next reboot: once set, it cannot be changed by this sysctl interface anymore.

---

<a id="rst-pty"></a>

## pty

See [Documentation/filesystems/devpts.rst](/kernel/internals/filesystems/devpts.md).

<a id="rst-random"></a>

## random

This is a directory, with the following entries:

- `boot_id`: a UUID generated the first time this is retrieved, and unvarying after that;

- `uuid`: a UUID generated every time this is retrieved (this can thus be used to generate UUIDs at will);

- `entropy_avail`: the pool's entropy count, in bits;

- `poolsize`: the entropy pool size, in bits;

- `urandom_min_reseed_secs`: obsolete (used to determine the minimum number of seconds between urandom pool reseeding). This file is writable for compatibility purposes, but writing to it has no effect on any RNG behavior;

- `write_wakeup_threshold`: when the entropy count drops below this (as a number of bits), processes waiting to write to `/dev/random` are woken up. This file is writable for compatibility purposes, but writing to it has no effect on any RNG behavior.

<a id="rst-randomize-va-space"></a>

## randomize_va_space

This option can be used to select the type of process address space randomization that is used in the system, for architectures that support this feature.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Turn the process address space randomization off.  This is the default for architectures that do not support this feature anyways, and kernels that are booted with the "norandmaps" parameter.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Make the addresses of mmap base, stack and VDSO page randomized. This, among other things, implies that shared libraries will be loaded to random addresses.  Also for PIE-linked binaries, the location of code start is randomized.  This is the default if the `CONFIG_COMPAT_BRK` option is enabled.

</td>
</tr>
<tr>
<td>


2

</td>
<td>


Additionally enable heap randomization.  This is the default if `CONFIG_COMPAT_BRK` is disabled.

There are a few legacy applications out there (such as some ancient versions of libc.so.5 from 1996) that assume that brk area starts just after the end of the code+bss.  These applications break when start of the brk area is randomized.  There are however no known non-legacy applications that would be broken this way, so for most systems it is safe to choose full randomization.

Systems with ancient and/or broken binaries should be configured with `CONFIG_COMPAT_BRK` enabled, which excludes the heap from process address space randomization.

</td>
</tr>
</tbody>
</table>

<a id="rst-reboot-cmd-sparc-only"></a>

## reboot-cmd (SPARC only)

??? This seems to be a way to give an argument to the Sparc ROM/Flash boot loader. Maybe to tell it what to do after rebooting. ???

<a id="rst-sched-energy-aware"></a>

## sched_energy_aware

Enables/disables Energy Aware Scheduling (EAS). EAS starts automatically on platforms where it can run (that is, platforms with asymmetric CPU topologies and having an Energy Model available). If your platform happens to meet the requirements for EAS but you do not want to use it, change this value to 0. On Non-EAS platforms, write operation fails and read doesn't return anything.

<a id="rst-task-delayacct"></a>

## task_delayacct

Enables/disables task delay accounting (see [Documentation/accounting/delay-accounting.rst](/kernel/internals/accounting/delay-accounting.md). Enabling this feature incurs a small amount of overhead in the scheduler but is useful for debugging and performance tuning. It is required by some tools such as iotop.

<a id="rst-sched-schedstats"></a>

## sched_schedstats

Enables/disables scheduler statistics. Enabling this feature incurs a small amount of overhead in the scheduler but is useful for debugging and performance tuning.

<a id="rst-sched-util-clamp-min"></a>

## sched_util_clamp_min

Max allowed *minimum* utilization.

Default value is 1024, which is the maximum possible value.

It means that any requested uclamp.min value cannot be greater than sched_util_clamp_min, i.e., it is restricted to the range \[0:sched_util_clamp_min\].

<a id="rst-sched-util-clamp-max"></a>

## sched_util_clamp_max

Max allowed *maximum* utilization.

Default value is 1024, which is the maximum possible value.

It means that any requested uclamp.max value cannot be greater than sched_util_clamp_max, i.e., it is restricted to the range \[0:sched_util_clamp_max\].

<a id="rst-sched-util-clamp-min-rt-default"></a>

## sched_util_clamp_min_rt_default

By default Linux is tuned for performance. Which means that RT tasks always run at the highest frequency and most capable (highest capacity) CPU (in heterogeneous systems).

Uclamp achieves this by setting the requested uclamp.min of all RT tasks to 1024 by default, which effectively boosts the tasks to run at the highest frequency and biases them to run on the biggest CPU.

This knob allows admins to change the default behavior when uclamp is being used. In battery powered devices particularly, running at the maximum capacity and frequency will increase energy consumption and shorten the battery life.

This knob is only effective for RT tasks which the user hasn't modified their requested uclamp.min value via sched_setattr() syscall.

This knob will not escape the range constraint imposed by sched_util_clamp_min defined above.

For example if

> sched_util_clamp_min_rt_default = 800 sched_util_clamp_min = 600

Then the boost will be clamped to 600 because 800 is outside of the permissible range of \[0:600\]. This could happen for instance if a powersave mode will restrict all boosts temporarily by modifying sched_util_clamp_min. As soon as this restriction is lifted, the requested sched_util_clamp_min_rt_default will take effect.

<a id="rst-seccomp"></a>

## seccomp

See [Documentation/userspace-api/seccomp_filter.rst](/kernel/userspace/userspace-api/security/seccomp-filter.md).

<a id="rst-sg-big-buff"></a>

## sg-big-buff

This file shows the size of the generic SCSI (sg) buffer. You can't tune it just yet, but you could change it on compile time by editing `include/scsi/sg.h` and changing the value of `SG_BIG_BUFF`.

There shouldn't be any reason to change this value. If you can come up with one, you probably know what you are doing anyway :)

<a id="rst-shmall"></a>

## shmall

This parameter sets the total amount of shared memory pages that can be used inside ipc namespace. The shared memory pages counting occurs for each ipc namespace separately and is not inherited. Hence, `shmall` should always be at least `ceil(shmmax/PAGE_SIZE)`.

If you are not sure what the default `PAGE_SIZE` is on your Linux system, you can run the following command:



```text
# getconf PAGE_SIZE
```

To reduce or disable the ability to allocate shared memory, you must create a new ipc namespace, set this parameter to the required value and prohibit the creation of a new ipc namespace in the current user namespace or cgroups can be used.

<a id="rst-shmmax"></a>

## shmmax

This value can be used to query and set the run time limit on the maximum shared memory segment size that can be created. Shared memory segments up to 1Gb are now supported in the kernel.  This value defaults to `SHMMAX`.

<a id="rst-shmmni"></a>

## shmmni

This value determines the maximum number of shared memory segments. 4096 by default (`SHMMNI`).

<a id="rst-shm-rmid-forced"></a>

## shm_rmid_forced

Linux lets you set resource limits, including how much memory one process can consume, via `setrlimit(2)`.  Unfortunately, shared memory segments are allowed to exist without association with any process, and thus might not be counted against any resource limits.  If enabled, shared memory segments are automatically destroyed when their attach count becomes zero after a detach or a process termination.  It will also destroy segments that were created, but never attached to, on exit from the process.  The only use left for `IPC_RMID` is to immediately destroy an unattached segment.  Of course, this breaks the way things are defined, so some applications might stop working.  Note that this feature will do you no good unless you also configure your resource limits (in particular, `RLIMIT_AS` and `RLIMIT_NPROC`).  Most systems don't need this.

Note that if you change this from 0 to 1, already created segments without users and with a dead originative process will be destroyed.

<a id="rst-sysctl-writes-strict"></a>

## sysctl_writes_strict

Control how file position affects the behavior of updating sysctl values via the `/proc/sys` interface:

>
> <table>
> <tbody>
> <tr>
> <td>
>
>
> -1
>
> </td>
> <td>
>
>
> Legacy per-write sysctl value handling, with no printk warnings. Each write syscall must fully contain the sysctl value to be written, and multiple writes on the same sysctl file descriptor will rewrite the sysctl value, regardless of file position.
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 0
>
> </td>
> <td>
>
>
> Same behavior as above, but warn about processes that perform writes to a sysctl file descriptor when the file position is not 0.
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 1
>
> </td>
> <td>
>
>
> (default) Respect file position when writing sysctl strings. Multiple writes will append to the sysctl value buffer. Anything past the max length of the sysctl value buffer will be ignored. Writes to numeric sysctl entries must always be at file position 0 and the value must be fully contained in the buffer sent in the write syscall.
>
> </td>
> </tr>
> </tbody>
> </table>

<a id="rst-softlockup-all-cpu-backtrace"></a>

## softlockup_all_cpu_backtrace

This value controls the soft lockup detector thread's behavior when a soft lockup condition is detected as to whether or not to gather further debug information. If enabled, each cpu will be issued an NMI and instructed to capture stack trace.

This feature is only applicable for architectures which support NMI.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Do nothing. This is the default behavior.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


On detection capture more debug information.

</td>
</tr>
</tbody>
</table>

<a id="rst-softlockup-panic"></a>

## softlockup_panic

This parameter can be used to control whether the kernel panics when a soft lockup is detected.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Don't panic on soft lockup.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Panic on soft lockup.

</td>
</tr>
</tbody>
</table>

This can also be set using the softlockup_panic kernel parameter.

<a id="rst-soft-watchdog"></a>

## soft_watchdog

This parameter can be used to control the soft lockup detector.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Disable the soft lockup detector.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Enable the soft lockup detector.

</td>
</tr>
</tbody>
</table>

The soft lockup detector monitors CPUs for threads that are hogging the CPUs without rescheduling voluntarily, and thus prevent the 'migration/N' threads from running, causing the watchdog work fail to execute. The mechanism depends on the CPUs ability to respond to timer interrupts which are needed for the watchdog work to be queued by the watchdog timer function, otherwise the NMI watchdog — if enabled — can detect a hard lockup condition.

<a id="rst-split-lock-mitigate-x86-only"></a>

## split_lock_mitigate (x86 only)

On x86, each "split lock" imposes a system-wide performance penalty. On larger systems, large numbers of split locks from unprivileged users can result in denials of service to well-behaved and potentially more important users.

The kernel mitigates these bad users by detecting split locks and imposing penalties: forcing them to wait and only allowing one core to execute split locks at a time.

These mitigations can make those bad applications unbearably slow. Setting split_lock_mitigate=0 may restore some application performance, but will also increase system exposure to denial of service attacks from split lock users.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Disable the mitigation mode - just warns the split lock on kernel log and exposes the system to denials of service from the split lockers.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Enable the mitigation mode (this is the default) - penalizes the split lockers with intentional performance degradation.

</td>
</tr>
</tbody>
</table>

<a id="rst-stack-erasing"></a>

## stack_erasing

This parameter can be used to control kernel stack erasing at the end of syscalls for kernels built with `CONFIG_KSTACK_ERASE`.

That erasing reduces the information which kernel stack leak bugs can reveal and blocks some uninitialized stack variable attacks. The tradeoff is the performance impact: on a single CPU system kernel compilation sees a 1% slowdown, other systems and workloads may vary.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Kernel stack erasing is disabled, KSTACK_ERASE_METRICS are not updated.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Kernel stack erasing is enabled (default), it is performed before returning to the userspace at the end of syscalls.

</td>
</tr>
</tbody>
</table>

<a id="rst-stop-a-sparc-only"></a>

## stop-a (SPARC only)

Controls Stop-A:


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Stop-A has no effect.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Stop-A breaks to the PROM (default).

</td>
</tr>
</tbody>
</table>

Stop-A is always enabled on a panic, so that the user can return to the boot PROM.

<a id="rst-sysrq"></a>

## sysrq

See [Documentation/admin-guide/sysrq.rst](/kernel/administration/admin-guide/diagnostics/sysrq.md).

<a id="rst-tainted"></a>

## tainted

Non-zero if the kernel has been tainted. Numeric values, which can be ORed together. The letters are seen in "Tainted" line of Oops reports.


<table>
<tbody>
<tr>
<td>


1

</td>
<td>


`(P)`

</td>
<td>


proprietary module was loaded

</td>
</tr>
<tr>
<td>


2

</td>
<td>


`(F)`

</td>
<td>


module was force loaded

</td>
</tr>
<tr>
<td>


4

</td>
<td>


`(S)`

</td>
<td>


kernel running on an out of specification system

</td>
</tr>
<tr>
<td>


8

</td>
<td>


`(R)`

</td>
<td>


module was force unloaded

</td>
</tr>
<tr>
<td>


16

</td>
<td>


`(M)`

</td>
<td>


processor reported a Machine Check Exception (MCE)

</td>
</tr>
<tr>
<td>


32

</td>
<td>


`(B)`

</td>
<td>


bad page referenced or some unexpected page flags

</td>
</tr>
<tr>
<td>


64

</td>
<td>


`(U)`

</td>
<td>


taint requested by userspace application

</td>
</tr>
<tr>
<td>


128

</td>
<td>


`(D)`

</td>
<td>


kernel died recently, i.e. there was an OOPS or BUG

</td>
</tr>
<tr>
<td>


256

</td>
<td>


`(A)`

</td>
<td>


an ACPI table was overridden by user

</td>
</tr>
<tr>
<td>


512

</td>
<td>


`(W)`

</td>
<td>


kernel issued warning

</td>
</tr>
<tr>
<td>


1024

</td>
<td>


`(C)`

</td>
<td>


staging driver was loaded

</td>
</tr>
<tr>
<td>


2048

</td>
<td>


`(I)`

</td>
<td>


workaround for bug in platform firmware applied

</td>
</tr>
<tr>
<td>


4096

</td>
<td>


`(O)`

</td>
<td>


externally-built ("out-of-tree") module was loaded

</td>
</tr>
<tr>
<td>


8192

</td>
<td>


`(E)`

</td>
<td>


unsigned module was loaded

</td>
</tr>
<tr>
<td>


16384

</td>
<td>


`(L)`

</td>
<td>


soft lockup occurred

</td>
</tr>
<tr>
<td>


32768

</td>
<td>


`(K)`

</td>
<td>


kernel has been live patched

</td>
</tr>
<tr>
<td>


65536

</td>
<td>


`(X)`

</td>
<td>


Auxiliary taint, defined and used by for distros

</td>
</tr>
<tr>
<td>


131072

</td>
<td>


`(T)`

</td>
<td>


The kernel was built with the struct randomization plugin

</td>
</tr>
</tbody>
</table>

See [Documentation/admin-guide/tainted-kernels.rst](/kernel/administration/admin-guide/diagnostics/tainted-kernels.md) for more information.

- **Note:**

  writes to this sysctl interface will fail with `EINVAL` if the kernel is booted with the command line option `panic_on_taint=<bitmask>,nousertaint` and any of the ORed together values being written to `tainted` match with the bitmask declared on panic_on_taint. See [Documentation/admin-guide/kernel-parameters.rst](/kernel/administration/admin-guide/boot/kernel-parameters.md) for more details on that particular kernel command line option and its optional `nousertaint` switch.

<a id="rst-threads-max"></a>

## threads-max

This value controls the maximum number of threads that can be created using `fork()`.

During initialization the kernel sets this value such that even if the maximum number of threads is created, the thread structures occupy only a part (1/8th) of the available RAM pages.

The minimum value that can be written to `threads-max` is 1.

The maximum value that can be written to `threads-max` is given by the constant `FUTEX_TID_MASK` (0x3fffffff).

If a value outside of this range is written to `threads-max` an `EINVAL` error occurs.

<a id="rst-timer-migration"></a>

## timer_migration

When set to a non-zero value, attempt to migrate timers away from idle cpus to allow them to remain in low power states longer.

Default is set (1).

<a id="rst-traceoff-on-warning"></a>

## traceoff_on_warning

When set, disables tracing (see [Documentation/trace/ftrace.rst](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/trace/ftrace.rst?id=9021cc14f7d98b4a1d2c932f52c5343d4d0f6b92)) when a `WARN()` is hit.

<a id="rst-tracepoint-printk"></a>

## tracepoint_printk

When tracepoints are sent to printk() (enabled by the `tp_printk` boot parameter), this entry provides runtime control:



```text
echo 0 > /proc/sys/kernel/tracepoint_printk
```

will stop tracepoints from being sent to printk(), and:



```text
echo 1 > /proc/sys/kernel/tracepoint_printk
```

will send them to printk() again.

This only works if the kernel was booted with `tp_printk` enabled.

See [Documentation/admin-guide/kernel-parameters.rst](/kernel/administration/admin-guide/boot/kernel-parameters.md) and [Documentation/trace/boottime-trace.rst](/kernel/development/trace/boottime-trace.md).

<a id="rst-unaligned-trap"></a>

## unaligned-trap

On architectures where unaligned accesses cause traps, and where this feature is supported (`CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW`; currently, `arc`, `parisc` and `loongarch`), controls whether unaligned traps are caught and emulated (instead of failing).


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Do not emulate unaligned accesses.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Emulate unaligned accesses. This is the default setting.

</td>
</tr>
</tbody>
</table>

See also [ignore-unaligned-usertrap](<#rst-ignore-unaligned-usertrap>).

<a id="rst-unknown-nmi-panic"></a>

## unknown_nmi_panic

The value in this file affects behavior of handling NMI. When the value is non-zero, unknown NMI is trapped and then panic occurs. At that time, kernel debugging information is displayed on console.

NMI switch that most IA32 servers have fires unknown NMI up, for example.  If a system hangs up, try pressing the NMI switch.

<a id="rst-unprivileged-bpf-disabled"></a>

## unprivileged_bpf_disabled

Writing 1 to this entry will disable unprivileged calls to `bpf()`; once disabled, calling `bpf()` without `CAP_SYS_ADMIN` or `CAP_BPF` will return `-EPERM`. Once set to 1, this can't be cleared from the running kernel anymore.

Writing 2 to this entry will also disable unprivileged calls to `bpf()`, however, an admin can still change this setting later on, if needed, by writing 0 or 1 to this entry.

If `BPF_UNPRIV_DEFAULT_OFF` is enabled in the kernel config, then this entry will default to 2 instead of 0.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Unprivileged calls to `bpf()` are enabled

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Unprivileged calls to `bpf()` are disabled without recovery

</td>
</tr>
<tr>
<td>


2

</td>
<td>


Unprivileged calls to `bpf()` are disabled

</td>
</tr>
</tbody>
</table>

<a id="rst-warn-limit"></a>

## warn_limit

Number of kernel warnings after which the kernel should panic when `panic_on_warn` is not set. Setting this to 0 disables checking the warning count. Setting this to 1 has the same effect as setting `panic_on_warn=1`. The default value is 0.

<a id="rst-watchdog"></a>

## watchdog

This parameter can be used to disable or enable the soft lockup detector *and* the NMI watchdog (i.e. the hard lockup detector) at the same time.


<table>
<tbody>
<tr>
<td>


0

</td>
<td>


Disable both lockup detectors.

</td>
</tr>
<tr>
<td>


1

</td>
<td>


Enable both lockup detectors.

</td>
</tr>
</tbody>
</table>

The soft lockup detector and the NMI watchdog can also be disabled or enabled individually, using the `soft_watchdog` and `nmi_watchdog` parameters. If the `watchdog` parameter is read, for example by executing:



```text
cat /proc/sys/kernel/watchdog
```

the output of this command (0 or 1) shows the logical OR of `soft_watchdog` and `nmi_watchdog`.

<a id="rst-watchdog-cpumask"></a>

## watchdog_cpumask

This value can be used to control on which cpus the watchdog may run. The default cpumask is all possible cores, but if `NO_HZ_FULL` is enabled in the kernel config, and cores are specified with the `nohz_full=` boot argument, those cores are excluded by default. Offline cores can be included in this mask, and if the core is later brought online, the watchdog will be started based on the mask value.

Typically this value would only be touched in the `nohz_full` case to re-enable cores that by default were not running the watchdog, if a kernel lockup was suspected on those cores.

The argument value is the standard cpulist format for cpumasks, so for example to enable the watchdog on cores 0, 2, 3, and 4 you might say:



```text
echo 0,2-4 > /proc/sys/kernel/watchdog_cpumask
```

<a id="rst-watchdog-thresh"></a>

## watchdog_thresh

This value can be used to control the frequency of hrtimer and NMI events and the soft and hard lockup thresholds. The default threshold is 10 seconds.

The softlockup threshold is (`2 * watchdog_thresh`). Setting this tunable to zero will disable lockup detection altogether.

---

# Documentation for /proc/sys/net/

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> Network sysctl interfaces, permission checks and configured feature boundaries.

> **Peios:** Linux capability names in this interface retain their API meaning, but KACS evaluates them through native token privileges or compatibility rules. UID 0, `setcap` and Unix mode bits do not independently grant native authority. Object access and PIP checks remain additional constraints where applicable. See [Peios kernel behaviour](</kernel/introduction/peios-behaviour.md>) for the mapping and exceptions.


<a id="rst-documentation-for-proc-sys-net"></a>

Copyright

Copyright (c) 1999

> - Terrehon Bowden &lt;[terrehon@pacbell.net](<mailto:terrehon@pacbell.net>)&gt;
>
> - Bodo Bauer &lt;[bb@ricochet.net](<mailto:bb@ricochet.net>)&gt;

Copyright (c) 2000

> - Jorge Nerin &lt;[comandante@zaralinux.com](<mailto:comandante@zaralinux.com>)&gt;

Copyright (c) 2009

> - Shen Feng &lt;[shen@cn.fujitsu.com](<mailto:shen@cn.fujitsu.com>)&gt;

For general info and legal blurb, please look in [index.rst](/kernel/administration/admin-guide/sysctl/index.md).

---

This article describes the sysctl files in `/proc/sys/net`.

For network-namespace sysctl tables registered through `net_sysctl_root`,
`net_ctl_permissions()` grants the table's owner-mode permissions to a caller
passing `CAP_NET_ADMIN`, which maps to enabled `SeTcbPrivilege` in Peios.
Otherwise the normal sysctl UID/group/mode selection still applies. Individual
handlers can add checks, and read-only entries do not become writable through
this callback. It is therefore inaccurate to describe every network sysctl as
requiring TCB, or every Unix-root caller as bypassing native checks.

The configured Peios network policy engine is NTFE. nftables, xtables,
bridge-netfilter and their policy interfaces are disabled; retained conntrack
or transport sysctls do not turn those policy engines back on.

The interface  to  the  networking  parts  of  the  kernel  is  located  in /proc/sys/net. The following table shows all possible subdirectories.  You may see only some of them, depending on your kernel's configuration.

Table : Subdirectories in /proc/sys/net

>
> <table>
> <thead>
> <tr>
> <th>
>
>
> Directory
>
> </th>
> <th>
>
>
> Content
>
> </th>
> <th>
>
>
>
>
> </th>
> <th>
>
>
> Directory
>
> </th>
> <th>
>
>
> Content
>
> </th>
> </tr>
> </thead>
> <tbody>
> <tr>
> <td>
>
>
> 802
>
> </td>
> <td>
>
>
> E802 protocol
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> mptcp
>
> </td>
> <td>
>
>
> Multipath TCP
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> appletalk
>
> </td>
> <td>
>
>
> Appletalk protocol
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> netfilter
>
> </td>
> <td>
>
>
> Network Filter
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> ax25
>
> </td>
> <td>
>
>
> AX25
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> netrom
>
> </td>
> <td>
>
>
> NET/ROM
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> bridge
>
> </td>
> <td>
>
>
> Bridging
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> rose
>
> </td>
> <td>
>
>
> X.25 PLP layer
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> core
>
> </td>
> <td>
>
>
> General parameter
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> tipc
>
> </td>
> <td>
>
>
> TIPC
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> ethernet
>
> </td>
> <td>
>
>
> Ethernet protocol
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> unix
>
> </td>
> <td>
>
>
> Unix domain sockets
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> ipv4
>
> </td>
> <td>
>
>
> IP version 4
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> vsock
>
> </td>
> <td>
>
>
> VSOCK sockets
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> ipv6
>
> </td>
> <td>
>
>
> IP version 6
>
> </td>
> <td>
>
>
>
>
> </td>
> <td>
>
>
> x25
>
> </td>
> <td>
>
>
> X.25 protocol
>
> </td>
> </tr>
> </tbody>
> </table>

<a id="rst-proc-sys-net-core-network-core-options"></a>

## 1. /proc/sys/net/core - Network core options

<a id="rst-bpf-jit-enable"></a>

### bpf_jit_enable

This enables the BPF Just in Time (JIT) compiler. BPF is a flexible and efficient infrastructure allowing to execute bytecode at various hook points. It is used in a number of Linux kernel subsystems such as networking (e.g. XDP, tc), tracing (e.g. kprobes, uprobes, tracepoints) and security (e.g. seccomp). LLVM has a BPF back end that can compile restricted C into a sequence of BPF instructions. After program load through bpf(2) and passing a verifier in the kernel, a JIT will then translate these BPF proglets into native CPU instructions. There are two flavors of JITs, the newer eBPF JIT currently supported on:

> - x86_64
>
> - x86_32
>
> - arm64
>
> - arm32
>
> - ppc64
>
> - ppc32
>
> - sparc64
>
> - mips64
>
> - s390x
>
> - riscv64
>
> - riscv32
>
> - loongarch64
>
> - arc

And the older cBPF JIT supported on the following archs:

> - mips
>
> - sparc

eBPF JITs are a superset of cBPF JITs, meaning the kernel will migrate cBPF instructions into eBPF instructions and then JIT compile them transparently. Older cBPF JITs can only translate tcpdump filters, seccomp rules, etc, but not mentioned eBPF programs loaded through bpf(2).

Values:

> - 0 - disable the JIT (default value)
>
> - 1 - enable the JIT
>
> - 2 - enable the JIT and ask the compiler to emit traces on kernel log.

<a id="rst-bpf-jit-harden"></a>

### bpf_jit_harden

This enables hardening for the BPF JIT compiler. Supported are eBPF JIT backends. Enabling hardening trades off performance, but can mitigate JIT spraying.

Values:

> - 0 - disable JIT hardening (default value)
>
> - 1 - enable JIT hardening for unprivileged users only
>
> - 2 - enable JIT hardening for all users

where "privileged user" in this context means a process having CAP_BPF or CAP_SYS_ADMIN in the root user name space.

<a id="rst-bpf-jit-kallsyms"></a>

### bpf_jit_kallsyms

When BPF JIT compiler is enabled, then compiled images are unknown addresses to the kernel, meaning they neither show up in traces nor in /proc/kallsyms. This enables export of these addresses, which can be used for debugging/tracing. If bpf_jit_harden is enabled, this feature is disabled.

Values :

> - 0 - disable JIT kallsyms export (default value)
>
> - 1 - enable JIT kallsyms export for privileged users only

<a id="rst-bpf-jit-limit"></a>

### bpf_jit_limit

This enforces a global limit for memory allocations to the BPF JIT compiler in order to reject unprivileged JIT requests once it has been surpassed. bpf_jit_limit contains the value of the global limit in bytes.

<a id="rst-dev-weight"></a>

### dev_weight

The maximum number of packets that kernel can handle on a NAPI interrupt, it's a Per-CPU variable. For drivers that support LRO or GRO_HW, a hardware aggregated packet is counted as one packet in this context.

Default: 64

<a id="rst-dev-weight-rx-bias"></a>

### dev_weight_rx_bias

RPS (e.g. RFS, aRFS) processing is competing with the registered NAPI poll function of the driver for the per softirq cycle netdev_budget. This parameter influences the proportion of the configured netdev_budget that is spent on RPS based packet processing during RX softirq cycles. It is further meant for making current dev_weight adaptable for asymmetric CPU needs on RX/TX side of the network stack. (see dev_weight_tx_bias) It is effective on a per CPU basis. Determination is based on dev_weight and is calculated multiplicative (dev_weight \* dev_weight_rx_bias).

Default: 1

<a id="rst-dev-weight-tx-bias"></a>

### dev_weight_tx_bias

Scales the maximum number of packets that can be processed during a TX softirq cycle. Effective on a per CPU basis. Allows scaling of current dev_weight for asymmetric net stack processing needs. Be careful to avoid making TX softirq processing a CPU hog.

Calculation is based on dev_weight (dev_weight \* dev_weight_tx_bias).

Default: 1

<a id="rst-default-qdisc"></a>

### default_qdisc

The default queuing discipline to use for network devices. This allows overriding the default of pfifo_fast with an alternative. Since the default queuing discipline is created without additional parameters so is best suited to queuing disciplines that work well without configuration like stochastic fair queue (sfq), CoDel (codel) or fair queue CoDel (fq_codel). Don't use queuing disciplines like Hierarchical Token Bucket or Deficit Round Robin which require setting up classes and bandwidths. Note that physical multiqueue interfaces still use mq as root qdisc, which in turn uses this default for its leaves. Virtual devices (like e.g. lo or veth) ignore this setting and instead default to noqueue.

Default: pfifo_fast

<a id="rst-busy-read"></a>

### busy_read

Low latency busy poll timeout for socket reads. (needs CONFIG_NET_RX_BUSY_POLL) Approximate time in us to busy loop waiting for packets on the device queue. This sets the default value of the SO_BUSY_POLL socket option. Can be set or overridden per socket by setting socket option SO_BUSY_POLL, which is the preferred method of enabling. If you need to enable the feature globally via sysctl, a value of 50 is recommended.

Will increase power usage.

Default: 0 (off)

<a id="rst-busy-poll"></a>

### busy_poll

Low latency busy poll timeout for poll and select. (needs CONFIG_NET_RX_BUSY_POLL) Approximate time in us to busy loop waiting for events. Recommended value depends on the number of sockets you poll on. For several sockets 50, for several hundreds 100. For more than that you probably want to use epoll. Note that only sockets with SO_BUSY_POLL set will be busy polled, so you want to either selectively set SO_BUSY_POLL on those sockets or set sysctl.net.busy_read globally.

Will increase power usage.

Default: 0 (off)

<a id="rst-mem-pcpu-rsv"></a>

### mem_pcpu_rsv

Per-cpu reserved forward alloc cache size in page units. Default 1MB per CPU.

<a id="rst-bypass-prot-mem"></a>

### bypass_prot_mem

Skip charging socket buffers to the global per-protocol memory accounting controlled by net.ipv4.tcp_mem, net.ipv4.udp_mem, etc.

Default: 0 (off)

<a id="rst-rmem-default"></a>

### rmem_default

The default setting of the socket receive buffer in bytes.

<a id="rst-rmem-max"></a>

### rmem_max

The maximum receive socket buffer size in bytes.

Default: 4194304

<a id="rst-rps-default-mask"></a>

### rps_default_mask

The default RPS CPU mask used on newly created network devices. An empty mask means RPS disabled by default.

<a id="rst-tstamp-allow-data"></a>

### tstamp_allow_data

Allow processes to receive tx timestamps looped together with the original packet contents. If disabled, transmit timestamp requests from unprivileged processes are dropped unless socket option SOF_TIMESTAMPING_OPT_TSONLY is set.

Default: 1 (on)

<a id="rst-wmem-default"></a>

### wmem_default

The default setting (in bytes) of the socket send buffer.

<a id="rst-wmem-max"></a>

### wmem_max

The maximum send socket buffer size in bytes.

Default: 4194304

<a id="rst-message-burst-and-message-cost"></a>

### message_burst and message_cost

These parameters  are used to limit the warning messages written to the kernel log from  the  networking  code.  They  enforce  a  rate  limit  to  make  a denial-of-service attack  impossible. A higher message_cost factor, results in fewer messages that will be written. Message_burst controls when messages will be dropped.  The  default  settings  limit  warning messages to one every five seconds.

<a id="rst-warnings"></a>

### warnings

This sysctl is now unused.

This was used to control console messages from the networking stack that occur because of problems on the network like duplicate address or bad checksums.

These messages are now emitted at KERN_DEBUG and can generally be enabled and controlled by the dynamic_debug facility.

<a id="rst-netdev-budget"></a>

### netdev_budget

Maximum number of packets taken from all interfaces in one polling cycle (NAPI poll). In one polling cycle interfaces which are registered to polling are probed in a round-robin manner. Also, a polling cycle may not exceed netdev_budget_usecs microseconds, even if netdev_budget has not been exhausted.

<a id="rst-netdev-budget-usecs"></a>

### netdev_budget_usecs

Maximum number of microseconds in one NAPI polling cycle. Polling will exit when either netdev_budget_usecs have elapsed during the poll cycle or the number of packets processed reaches netdev_budget.

<a id="rst-netdev-max-backlog"></a>

### netdev_max_backlog

Maximum number of packets, queued on the INPUT side, when the interface receives packets faster than kernel can process them.

<a id="rst-qdisc-max-burst"></a>

### qdisc_max_burst

Maximum number of packets that can be temporarily stored before reaching qdisc.

Default: 1000

<a id="rst-netdev-rss-key"></a>

### netdev_rss_key

RSS (Receive Side Scaling) enabled drivers use a host key that is randomly generated. Some user space might need to gather its content even if drivers do not provide ethtool -x support yet.



```text
myhost:~# cat /proc/sys/net/core/netdev_rss_key
84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8: ... (256 bytes total)
```

File contains all nul bytes if no driver ever called netdev_rss_key_fill() function.

- **Note:**

  /proc/sys/net/core/netdev_rss_key contains 256 bytes of key, but many drivers only use 40 or 52 bytes of it.



```text
myhost:~# ethtool -x eth0
RX flow hash indirection table for eth0 with 8 RX ring(s):
    0:    0     1     2     3     4     5     6     7
RSS hash key:
84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8:43:e3:c9:0c:fd:17:55:c2:3a:4d:69:ed:f1:42:89
```

<a id="rst-netdev-tstamp-prequeue"></a>

### netdev_tstamp_prequeue

If set to 0, RX packet timestamps can be sampled after RPS processing, when the target CPU processes packets. It might give some delay on timestamps, but permit to distribute the load on several cpus.

If set to 1 (default), timestamps are sampled as soon as possible, before queueing.

<a id="rst-netdev-unregister-timeout-secs"></a>

### netdev_unregister_timeout_secs

Unregister network device timeout in seconds. This option controls the timeout (in seconds) used to issue a warning while waiting for a network device refcount to drop to 0 during device unregistration. A lower value may be useful during bisection to detect a leaked reference faster. A larger value may be useful to prevent false warnings on slow/loaded systems. Default value is 10, minimum 1, maximum 3600.

<a id="rst-skb-defer-max"></a>

### skb_defer_max

Max size (in skbs) of the per-cpu list of skbs being freed by the cpu which allocated them.

Default: 128

<a id="rst-optmem-max"></a>

### optmem_max

Maximum ancillary buffer size allowed per socket. Ancillary data is a sequence of struct cmsghdr structures with appended data. TCP tx zerocopy also uses optmem_max as a limit for its internal structures.

Default : 128 KB

<a id="rst-fb-tunnels-only-for-init-net"></a>

### fb_tunnels_only_for_init_net

Controls if fallback tunnels (like tunl0, gre0, gretap0, erspan0, sit0, ip6tnl0, ip6gre0) are automatically created. There are 3 possibilities (a) value = 0; respective fallback tunnels are created when module is loaded in every net namespaces (backward compatible behavior). (b) value = 1; \[kcmd value: initns\] respective fallback tunnels are created only in init net namespace and every other net namespace will not have them. (c) value = 2; \[kcmd value: none\] fallback tunnels are not created when a module is loaded in any of the net namespace. Setting value to "2" is pointless after boot if these modules are built-in, so there is a kernel command-line option that can change this default. Please refer to [Documentation/admin-guide/kernel-parameters.txt](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt?id=9021cc14f7d98b4a1d2c932f52c5343d4d0f6b92) for additional details.

Not creating fallback tunnels gives control to userspace to create whatever is needed only and avoid creating devices which are redundant.

Default : 0  (for compatibility reasons)

<a id="rst-devconf-inherit-init-net"></a>

### devconf_inherit_init_net

Controls if a new network namespace should inherit all current settings under /proc/sys/net/\{ipv4,ipv6\}/conf/\{all,default\}/. By default, we keep the current behavior: for IPv4 we inherit all current settings from init_net and for IPv6 we reset all settings to default.

If set to 1, both IPv4 and IPv6 settings are forced to inherit from current ones in init_net. If set to 2, both IPv4 and IPv6 settings are forced to reset to their default values. If set to 3, both IPv4 and IPv6 settings are forced to inherit from current ones in the netns where this new netns has been created.

Default : 0  (for compatibility reasons)

<a id="rst-txrehash"></a>

### txrehash

Controls default hash rethink behaviour on socket when SO_TXREHASH option is set to SOCK_TXREHASH_DEFAULT (i. e. not overridden by setsockopt).

If set to 1 (default), hash rethink is performed on listening socket. If set to 0, hash rethink is not performed.

<a id="rst-txq-reselection-ms"></a>

### txq_reselection_ms

Controls how often (in ms) a busy connected flow can select another tx queue.

A resection is desirable when/if user thread has migrated and XPS would select a different queue. Same can occur without XPS if the flow hash has changed.

But switching txq can introduce reorders, especially if the old queue is under high pressure. Modern TCP stacks deal well with reorders if they happen not too often.

To disable this feature, set the value to 0.

Default : 1000

<a id="rst-gro-normal-batch"></a>

### gro_normal_batch

Maximum number of the segments to batch up on output of GRO. When a packet exits GRO, either as a coalesced superframe or as an original packet which GRO has decided not to coalesce, it is placed on a per-NAPI list. This list is then passed to the stack when the number of segments reaches the gro_normal_batch limit.

<a id="rst-high-order-alloc-disable"></a>

### high_order_alloc_disable

By default the allocator for page frags tries to use high order pages (order-3 on x86). While the default behavior gives good results in most cases, some users might have hit a contention in page allocations/freeing. This was especially true on older kernels (&lt; 5.14) when high-order pages were not stored on per-cpu lists. This allows to opt-in for order-0 allocation instead but is now mostly of historical importance.

Default: 0

<a id="rst-proc-sys-net-unix-parameters-for-unix-domain-sockets"></a>

### 2. /proc/sys/net/unix - Parameters for Unix domain sockets

There is only one file in this directory. unix_dgram_qlen limits the max number of datagrams queued in Unix domain socket's buffer. It will not take effect unless PF_UNIX flag is specified.

<a id="rst-proc-sys-net-ipv4-ipv4-settings"></a>

### 3. /proc/sys/net/ipv4 - IPV4 settings

Please see: [Documentation/networking/ip-sysctl.rst](/kernel/internals/networking/ip-sysctl.md) and [Documentation/admin-guide/sysctl/net.rst](/kernel/administration/admin-guide/sysctl/net.md) for descriptions of these entries.

<a id="rst-appletalk"></a>

### 4. Appletalk

The /proc/sys/net/appletalk  directory  holds the Appletalk configuration data when Appletalk is loaded. The configurable parameters are:

<a id="rst-aarp-expiry-time"></a>

### aarp-expiry-time

The amount  of  time  we keep an ARP entry before expiring it. Used to age out old hosts.

<a id="rst-aarp-resolve-time"></a>

### aarp-resolve-time

The amount of time we will spend trying to resolve an Appletalk address.

<a id="rst-aarp-retransmit-limit"></a>

### aarp-retransmit-limit

The number of times we will retransmit a query before giving up.

<a id="rst-aarp-tick-time"></a>

### aarp-tick-time

Controls the rate at which expires are checked.

The directory  /proc/net/appletalk  holds the list of active Appletalk sockets on a machine.

The fields  indicate  the DDP type, the local address (in network:node format) the remote  address,  the  size of the transmit pending queue, the size of the received queue  (bytes waiting for applications to read) the state and the uid owning the socket.

/proc/net/atalk_iface lists  all  the  interfaces  configured for appletalk.It shows the  name  of the interface, its Appletalk address, the network range on that address  (or  network number for phase 1 networks), and the status of the interface.

/proc/net/atalk_route lists  each  known  network  route.  It lists the target (network) that the route leads to, the router (may be directly connected), the route flags, and the device the route is using.

<a id="rst-tipc"></a>

### 5. TIPC

<a id="rst-tipc-rmem"></a>

### tipc_rmem

The TIPC protocol now has a tunable for the receive memory, similar to the tcp_rmem - i.e. a vector of 3 INTEGERs: (min, default, max)



```text
# cat /proc/sys/net/tipc/tipc_rmem
4252725 34021800        68043600
#
```

The max value is set to CONN_OVERLOAD_LIMIT, and the default and min values are scaled (shifted) versions of that same value.  Note that the min value is not at this point in time used in any meaningful way, but the triplet is preserved in order to be consistent with things like tcp_rmem.

<a id="rst-named-timeout"></a>

### named_timeout

TIPC name table updates are distributed asynchronously in a cluster, without any form of transaction handling. This means that different race scenarios are possible. One such is that a name withdrawal sent out by one node and received by another node may arrive after a second, overlapping name publication already has been accepted from a third node, although the conflicting updates originally may have been issued in the correct sequential order. If named_timeout is nonzero, failed topology updates will be placed on a defer queue until another event arrives that clears the error, or until the timeout expires. Value is in milliseconds.

<a id="rst-proc-sys-net-vsock-vsock-sockets"></a>

### 6. /proc/sys/net/vsock - VSOCK sockets

VSOCK sockets (AF_VSOCK) provide communication between virtual machines and their hosts. The behavior of VSOCK sockets in a network namespace is determined by the namespace's mode (`global` or `local`), which controls how CIDs (Context IDs) are allocated and how sockets interact across namespaces.

<a id="rst-ns-mode"></a>

### ns_mode

Read-only. Reports the current namespace's mode, set at namespace creation and immutable thereafter.

Values:

> - `global` - the namespace shares system-wide CID allocation and its sockets can reach any VM or socket in any global namespace. Sockets in this namespace cannot reach sockets in local namespaces.
>
> - `local` - the namespace has private CID allocation and its sockets can only connect to VMs or sockets within the same namespace.

The init_net mode is always `global`.

<a id="rst-child-ns-mode"></a>

### child_ns_mode

Controls what mode newly created child namespaces will inherit. At namespace creation, `ns_mode` is inherited from the parent's `child_ns_mode`. The initial value matches the namespace's own `ns_mode`.

Values:

> - `global` - child namespaces will share system-wide CID allocation and their sockets will be able to reach any VM or socket in any global namespace.
>
> - `local` - child namespaces will have private CID allocation and their sockets will only be able to connect within their own namespace.

The first write to `child_ns_mode` locks its value. Subsequent writes of the same value succeed, but writing a different value returns `-EBUSY`.

Changing `child_ns_mode` only affects namespaces created after the change; it does not modify the current namespace or any existing children.

A namespace with `ns_mode` set to `local` cannot change `child_ns_mode` to `global` (returns `-EPERM`).

---

# Documentation for /proc/sys/sunrpc/

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> kernel version 2.2.10

<a id="rst-documentation-for-proc-sys-sunrpc"></a>

kernel version 2.2.10

Copyright (c) 1998, 1999,  Rik van Riel &lt;[riel@nl.linux.org](<mailto:riel@nl.linux.org>)&gt;

For general info and legal blurb, please look in [index.rst](/kernel/administration/admin-guide/sysctl/index.md).

---

This file contains the documentation for the sysctl files in /proc/sys/sunrpc and is valid for Linux kernel version 2.2.

The files in this directory can be used to (re)set the debug flags of the SUN Remote Procedure Call (RPC) subsystem in the Linux kernel. This stuff is used for NFS, KNFSD and maybe a few other things as well.

The files in there are used to control the debugging flags: rpc_debug, nfs_debug, nfsd_debug and nlm_debug.

These flags are for kernel hackers only. You should read the source code in net/sunrpc/ for more information.

---

# Documentation for /proc/sys/user/

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> kernel version 4.9.0

> **Peios:** Namespace resource limits do not grant permission to create a namespace. Native token, mount-namespace and capability checks still apply. See [Peios kernel behaviour](</kernel/introduction/peios-behaviour.md>).


<a id="rst-documentation-for-proc-sys-user"></a>

kernel version 4.9.0

Copyright (c) 2016              Eric Biederman &lt;[ebiederm@xmission.com](<mailto:ebiederm@xmission.com>)&gt;

---

This file contains the documentation for the sysctl files in /proc/sys/user.

The files in this directory can be used to override the default limits on the number of namespaces and other objects that have per user per user namespace limits.

The primary purpose of these limits is to stop programs that malfunction and attempt to create a ridiculous number of objects, before the malfunction becomes a system wide problem.  It is the intention that the defaults of these limits are set high enough that no program in normal operation should run into these limits.

The creation of per user per user namespace objects are charged to the user in the user namespace who created the object and verified to be below the per user limit in that user namespace.

The creation of objects is also charged to all of the users who created user namespaces the creation of the object happens in (user namespaces can be nested) and verified to be below the per user limits in the user namespaces of those users.

This recursive counting of created objects ensures that creating a user namespace does not allow a user to escape their current limits.

Currently, these files are in /proc/sys/user:

<a id="rst-max-cgroup-namespaces"></a>

## max_cgroup_namespaces

> The maximum number of cgroup namespaces that any user in the current user namespace may create.

<a id="rst-max-ipc-namespaces"></a>

## max_ipc_namespaces

> The maximum number of ipc namespaces that any user in the current user namespace may create.

<a id="rst-max-mnt-namespaces"></a>

## max_mnt_namespaces

> The maximum number of mount namespaces that any user in the current user namespace may create.

<a id="rst-max-net-namespaces"></a>

## max_net_namespaces

> The maximum number of network namespaces that any user in the current user namespace may create.

<a id="rst-max-pid-namespaces"></a>

## max_pid_namespaces

> The maximum number of pid namespaces that any user in the current user namespace may create.

<a id="rst-max-time-namespaces"></a>

## max_time_namespaces

> The maximum number of time namespaces that any user in the current user namespace may create.

<a id="rst-max-user-namespaces"></a>

## max_user_namespaces

> The maximum number of user namespaces that any user in the current user namespace may create.

<a id="rst-max-uts-namespaces"></a>

## max_uts_namespaces

> The maximum number of user namespaces that any user in the current user namespace may create.

---

# Documentation for /proc/sys/vm/

_Peios Kernel / Administration / System administration / Runtime settings with sysctl_

> kernel version 2.6.29

> **Peios:** References to Unix root and file modes below describe the inherited interface conventions. They are not sufficient Peios authorization: native descriptor/handle checks, the separate sysfs write gate, and mapped native privileges apply as appropriate. Debugfs additionally remains subject to integrity lockdown. See [Peios kernel behaviour](</kernel/introduction/peios-behaviour.md>).


<a id="rst-documentation-for-proc-sys-vm"></a>

kernel version 2.6.29

Copyright (c) 1998, 1999,  Rik van Riel &lt;[riel@nl.linux.org](<mailto:riel@nl.linux.org>)&gt;

Copyright (c) 2008         Peter W. Morreale &lt;[pmorreale@novell.com](<mailto:pmorreale@novell.com>)&gt;

For general info and legal blurb, please look in [index.rst](/kernel/administration/admin-guide/sysctl/index.md).

---

This file contains the documentation for the sysctl files in /proc/sys/vm and is valid for Linux kernel version 2.6.29.

The files in this directory can be used to tune the operation of the virtual memory (VM) subsystem of the Linux kernel and the writeout of dirty data to disk.

Default values and initialization routines for most of these files can be found in mm/swap.c.

Currently, these files are in /proc/sys/vm:

- admin_reserve_kbytes

- compact_memory

- compaction_proactiveness

- compact_unevictable_allowed

- defrag_mode

- dirty_background_bytes

- dirty_background_ratio

- dirty_bytes

- dirty_expire_centisecs

- dirty_ratio

- dirtytime_expire_seconds

- dirty_writeback_centisecs

- drop_caches

- enable_soft_offline

- extfrag_threshold

- highmem_is_dirtyable

- hugetlb_shm_group

- legacy_va_layout

- lowmem_reserve_ratio

- max_map_count

- mem_profiling         (only if CONFIG_MEM_ALLOC_PROFILING=y)

- memory_failure_early_kill

- memory_failure_recovery

- min_free_kbytes

- min_slab_ratio

- min_unmapped_ratio

- mmap_min_addr

- mmap_rnd_bits

- mmap_rnd_compat_bits

- movable_gigantic_pages

- nr_hugepages

- nr_hugepages_mempolicy

- nr_overcommit_hugepages

- nr_trim_pages         (only if CONFIG_MMU=n)

- numa_zonelist_order

- oom_dump_tasks

- oom_kill_allocating_task

- overcommit_kbytes

- overcommit_memory

- overcommit_ratio

- page-cluster

- page_lock_unfairness

- panic_on_oom

- percpu_pagelist_high_fraction

- stat_interval

- stat_refresh

- numa_stat

- swappiness

- unprivileged_userfaultfd

- user_reserve_kbytes

- vfs_cache_pressure

- vfs_cache_pressure_denom

- watermark_boost_factor

- watermark_scale_factor

- zone_reclaim_mode

<a id="rst-admin-reserve-kbytes"></a>

## admin_reserve_kbytes

The amount of free memory in the system that should be reserved for users with the capability cap_sys_admin.

admin_reserve_kbytes defaults to min(3% of free pages, 8MB)

That should provide enough for the admin to log in and kill a process, if necessary, under the default overcommit 'guess' mode.

Systems running under overcommit 'never' should increase this to account for the full Virtual Memory Size of programs used to recover. Otherwise, root may not be able to log in to recover the system.

How do you calculate a minimum useful reserve?

sshd or login + bash (or some other shell) + top (or ps, kill, etc.)

For overcommit 'guess', we can sum resident set sizes (RSS). On x86_64 this is about 8MB.

For overcommit 'never', we can take the max of their virtual sizes (VSZ) and add the sum of their RSS. On x86_64 this is about 128MB.

Changing this takes effect whenever an application requests memory.

<a id="rst-compact-memory"></a>

## compact_memory

Available only when CONFIG_COMPACTION is set. When 1 is written to the file, all zones are compacted such that free memory is available in contiguous blocks where possible. This can be important for example in the allocation of huge pages although processes will also directly compact memory as required.

<a id="rst-compaction-proactiveness"></a>

## compaction_proactiveness

This tunable takes a value in the range \[0, 100\] with a default value of 20. This tunable determines how aggressively compaction is done in the background. Write of a non zero value to this tunable will immediately trigger the proactive compaction. Setting it to 0 disables proactive compaction.

Note that compaction has a non-trivial system-wide impact as pages belonging to different processes are moved around, which could also lead to latency spikes in unsuspecting applications. The kernel employs various heuristics to avoid wasting CPU cycles if it detects that proactive compaction is not being effective.

Setting the value above 80 will, in addition to lowering the acceptable level of fragmentation, make the compaction code more sensitive to increases in fragmentation, i.e. compaction will trigger more often, but reduce fragmentation by a smaller amount. This makes the fragmentation level more stable over time.

Be careful when setting it to extreme values like 100, as that may cause excessive background compaction activity.

<a id="rst-compact-unevictable-allowed"></a>

## compact_unevictable_allowed

Available only when CONFIG_COMPACTION is set. When set to 1, compaction is allowed to examine the unevictable lru (mlocked pages) for pages to compact. This should be used on systems where stalls for minor page faults are an acceptable trade for large contiguous free memory.  Set to 0 to prevent compaction from moving pages that are unevictable.  Default value is 1. On CONFIG_PREEMPT_RT the default value is 0 in order to avoid a page fault, due to compaction, which would block the task from becoming active until the fault is resolved.

<a id="rst-defrag-mode"></a>

## defrag_mode

When set to 1, the page allocator tries harder to avoid fragmentation and maintain the ability to produce huge pages / higher-order pages.

It is recommended to enable this right after boot, as fragmentation, once it occurred, can be long-lasting or even permanent.

<a id="rst-dirty-background-bytes"></a>

## dirty_background_bytes

Contains the amount of dirty memory at which the background kernel flusher threads will start writeback.

- **Note:**

  dirty_background_bytes is the counterpart of dirty_background_ratio. Only one of them may be specified at a time. When one sysctl is written it is immediately taken into account to evaluate the dirty memory limits and the other appears as 0 when read.

<a id="rst-dirty-background-ratio"></a>

## dirty_background_ratio

Contains, as a percentage of total available memory that contains free pages and reclaimable pages, the number of pages at which the background kernel flusher threads will start writing out dirty data.

The total available memory is not equal to total system memory.

<a id="rst-dirty-bytes"></a>

## dirty_bytes

Contains the amount of dirty memory at which a process generating disk writes will itself start writeback.

Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be specified at a time. When one sysctl is written it is immediately taken into account to evaluate the dirty memory limits and the other appears as 0 when read.

Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any value lower than this limit will be ignored and the old configuration will be retained.

<a id="rst-dirty-expire-centisecs"></a>

## dirty_expire_centisecs

This tunable is used to define when dirty data is old enough to be eligible for writeout by the kernel flusher threads.  It is expressed in 100'ths of a second.  Data which has been dirty in-memory for longer than this interval will be written out next time a flusher thread wakes up.

<a id="rst-dirty-ratio"></a>

## dirty_ratio

Contains, as a percentage of total available memory that contains free pages and reclaimable pages, the number of pages at which a process which is generating disk writes will itself start writing out dirty data.

The total available memory is not equal to total system memory.

<a id="rst-dirtytime-expire-seconds"></a>

## dirtytime_expire_seconds

When a lazytime inode is constantly having its pages dirtied, the inode with an updated timestamp will never get chance to be written out.  And, if the only thing that has happened on the file system is a dirtytime inode caused by an atime update, a worker will be scheduled to make sure that inode eventually gets pushed out to disk.  This tunable is used to define when dirty inode is old enough to be eligible for writeback by the kernel flusher threads. And, it is also used as the interval to wakeup dirtytime_writeback thread.

Setting this to zero disables periodic dirtytime writeback.

<a id="rst-dirty-writeback-centisecs"></a>

## dirty_writeback_centisecs

The kernel flusher threads will periodically wake up and write `old` data out to disk.  This tunable expresses the interval between those wakeups, in 100'ths of a second.

Setting this to zero disables periodic writeback altogether.

<a id="rst-drop-caches"></a>

## drop_caches

Writing to this will cause the kernel to drop clean caches, as well as reclaimable slab objects like dentries and inodes.  Once dropped, their memory becomes free.

To free pagecache:



```text
echo 1 > /proc/sys/vm/drop_caches
```

To free reclaimable slab objects (includes dentries and inodes):



```text
echo 2 > /proc/sys/vm/drop_caches
```

To free slab objects and pagecache:



```text
echo 3 > /proc/sys/vm/drop_caches
```

This is a non-destructive operation and will not free any dirty objects. To increase the number of objects freed by this operation, the user may run `sync` prior to writing to /proc/sys/vm/drop_caches.  This will minimize the number of dirty objects on the system and create more candidates to be dropped.

This file is not a means to control the growth of the various kernel caches (inodes, dentries, pagecache, etc...)  These objects are automatically reclaimed by the kernel when memory is needed elsewhere on the system.

Use of this file can cause performance problems.  Since it discards cached objects, it may cost a significant amount of I/O and CPU to recreate the dropped objects, especially if they were under heavy use.  Because of this, use outside of a testing or debugging environment is not recommended.

You may see informational messages in your kernel log when this file is used:



```text
cat (1234): drop_caches: 3
```

These are informational only.  They do not mean that anything is wrong with your system.  To disable them, echo 4 (bit 2) into drop_caches.

<a id="rst-enable-soft-offline"></a>

## enable_soft_offline

Correctable memory errors are very common on servers. Soft-offline is kernel's solution for memory pages having (excessive) corrected memory errors.

For different types of page, soft-offline has different behaviors / costs.

- For a raw error page, soft-offline migrates the in-use page's content to a new raw page.

- For a page that is part of a transparent hugepage, soft-offline splits the transparent hugepage into raw pages, then migrates only the raw error page. As a result, user is transparently backed by 1 less hugepage, impacting memory access performance.

- For a page that is part of a HugeTLB hugepage, soft-offline first migrates the entire HugeTLB hugepage, during which a free hugepage will be consumed as migration target.  Then the original hugepage is dissolved into raw pages without compensation, reducing the capacity of the HugeTLB pool by 1.

It is user's call to choose between reliability (staying away from fragile physical memory) vs performance / capacity implications in transparent and HugeTLB cases.

For all architectures, enable_soft_offline controls whether to soft offline memory pages.  When set to 1, kernel attempts to soft offline the pages whenever it thinks needed.  When set to 0, kernel returns EOPNOTSUPP to the request to soft offline the pages.  Its default value is 1.

It is worth mentioning that after setting enable_soft_offline to 0, the following requests to soft offline pages will not be performed:

- Request to soft offline pages from RAS Correctable Errors Collector.

- On ARM, the request to soft offline pages from GHES driver.

- On PARISC, the request to soft offline pages from Page Deallocation Table.

<a id="rst-extfrag-threshold"></a>

## extfrag_threshold

This parameter affects whether the kernel will compact memory or direct reclaim to satisfy a high-order allocation. The extfrag/extfrag_index file in debugfs shows what the fragmentation index for each order is in each zone in the system. Values tending towards 0 imply allocations would fail due to lack of memory, values towards 1000 imply failures are due to fragmentation and -1 implies that the allocation will succeed as long as watermarks are met.

The kernel will not compact memory in a zone if the fragmentation index is &lt;= extfrag_threshold. The default value is 500.

<a id="rst-highmem-is-dirtyable"></a>

## highmem_is_dirtyable

Available only for systems with CONFIG_HIGHMEM enabled (32b systems).

This parameter controls whether the high memory is considered for dirty writers throttling.  This is not the case by default which means that only the amount of memory directly visible/usable by the kernel can be dirtied. As a result, on systems with a large amount of memory and lowmem basically depleted writers might be throttled too early and streaming writes can get very slow.

Changing the value to non zero would allow more memory to be dirtied and thus allow writers to write more data which can be flushed to the storage more effectively. Note this also comes with a risk of pre-mature OOM killer because some writers (e.g. direct block device writes) can only use the low memory and they can fill it up with dirty data without any throttling.

<a id="rst-hugetlb-shm-group"></a>

## hugetlb_shm_group

hugetlb_shm_group contains group id that is allowed to create SysV shared memory segment using hugetlb page.

<a id="rst-legacy-va-layout"></a>

## legacy_va_layout

If non-zero, this sysctl disables the new 32-bit mmap layout - the kernel will use the legacy (2.4) layout for all processes.

<a id="rst-lowmem-reserve-ratio"></a>

## lowmem_reserve_ratio

For some specialised workloads on highmem machines it is dangerous for the kernel to allow process memory to be allocated from the "lowmem" zone.  This is because that memory could then be pinned via the mlock() system call, or by unavailability of swapspace.

And on large highmem machines this lack of reclaimable lowmem memory can be fatal.

So the Linux page allocator has a mechanism which prevents allocations which *could* use highmem from using too much lowmem.  This means that a certain amount of lowmem is defended from the possibility of being captured into pinned user memory.

(The same argument applies to the old 16 megabyte ISA DMA region.  This mechanism will also defend that region from allocations which could use highmem or lowmem).

The `lowmem_reserve_ratio` tunable determines how aggressive the kernel is in defending these lower zones.

If you have a machine which uses highmem or ISA DMA and your applications are using mlock(), or if you are running with no swap then you probably should change the lowmem_reserve_ratio setting.

The lowmem_reserve_ratio is an array. You can see them by reading this file:



```text
% cat /proc/sys/vm/lowmem_reserve_ratio
256     256     32
```

But, these values are not used directly. The kernel calculates \# of protection pages for each zones from them. These are shown as array of protection pages in /proc/zoneinfo like the following. (This is an example of x86-64 box). Each zone has an array of protection pages like this:



```text
Node 0, zone      DMA
  pages free     1355
        min      3
        low      3
        high     4
      :
      :
    numa_other   0
        protection: (0, 2004, 2004, 2004)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  pagesets
    cpu: 0 pcp: 0
        :
```

These protections are added to score to judge whether this zone should be used for page allocation or should be reclaimed.

In this example, if normal pages (index=2) are required to this DMA zone and watermark\[WMARK_HIGH\] is used for watermark, the kernel judges this zone should not be used because pages_free(1355) is smaller than watermark + protection\[2\] (4 + 2004 = 2008). If this protection value is 0, this zone would be used for normal page requirement. If requirement is DMA zone(index=0), protection\[0\] (=0) is used.

zone\[i\]'s protection\[j\] is calculated by following expression:



```text
(i < j):
  zone[i]->protection[j]
  = (total sums of managed_pages from zone[i+1] to zone[j] on the node)
    / lowmem_reserve_ratio[i];
(i = j):
   (should not be protected. = 0;
(i > j):
   (not necessary, but looks 0)
```

The default values of lowmem_reserve_ratio\[i\] are

>
> <table>
> <tbody>
> <tr>
> <td>
>
>
> 256
>
> </td>
> <td>
>
>
> (if zone\[i\] means DMA or DMA32 zone)
>
> </td>
> </tr>
> <tr>
> <td>
>
>
> 32
>
> </td>
> <td>
>
>
> (others)
>
> </td>
> </tr>
> </tbody>
> </table>

As above expression, they are reciprocal number of ratio. 256 means 1/256. \# of protection pages becomes about "0.39%" of total managed pages of higher zones on the node.

If you would like to protect more pages, smaller values are effective. The minimum value is 1 (1/1 -&gt; 100%). The value less than 1 completely disables protection of the pages.

<a id="rst-max-map-count"></a>

## max_map_count

This file contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap, mprotect, and madvise, and also when loading shared libraries.

While most applications need less than a thousand maps, certain programs, particularly malloc debuggers, may consume lots of them, e.g., up to one or two maps per allocation.

The default value is 65530.

<a id="rst-mem-profiling"></a>

## mem_profiling

Enable memory profiling (when CONFIG_MEM_ALLOC_PROFILING=y)

1: Enable memory profiling.

0: Disable memory profiling.

Enabling memory profiling introduces a small performance overhead for all memory allocations.

The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT.

When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, this control is read-only to avoid warnings produced by allocations made while profiling is disabled and freed when it's enabled.

<a id="rst-memory-failure-early-kill"></a>

## memory_failure_early_kill

Control how to kill processes when uncorrected memory error (typically a 2bit error in a memory module) is detected in the background by hardware that cannot be handled by the kernel. In some cases (like the page still having a valid copy on disk) the kernel will handle the failure transparently without affecting any applications. But if there is no other up-to-date copy of the data it will kill to prevent any data corruptions from propagating.

1: Kill all processes that have the corrupted and not reloadable page mapped as soon as the corruption is detected.  Note this is not supported for a few types of pages, like kernel internally allocated data or the swap cache, but works for the majority of user pages.

0: Only unmap the corrupted page from all processes and only kill a process who tries to access it.

The kill is done using a catchable SIGBUS with BUS_MCEERR_AO, so processes can handle this if they want to.

This is only active on architectures/platforms with advanced machine check handling and depends on the hardware capabilities.

Applications can override this setting individually with the PR_MCE_KILL prctl

<a id="rst-memory-failure-recovery"></a>

## memory_failure_recovery

Enable memory failure recovery (when supported by the platform)

1: Attempt recovery.

0: Always panic on a memory failure.

<a id="rst-min-free-kbytes"></a>

## min_free_kbytes

This is used to force the Linux VM to keep a minimum number of kilobytes free.  The VM uses this number to compute a watermark\[WMARK_MIN\] value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size.

Some minimal amount of memory is needed to satisfy PF_MEMALLOC allocations; if you set this to lower than 1024KB, your system will become subtly broken, and prone to deadlock under high loads.

Setting this too high will OOM your machine instantly.

<a id="rst-min-slab-ratio"></a>

## min_slab_ratio

This is available only on NUMA kernels.

A percentage of the total pages in each zone.  On Zone reclaim (fallback from the local zone occurs) slabs will be reclaimed if more than this percentage of pages in a zone are reclaimable slab pages. This insures that the slab growth stays under control even in NUMA systems that rarely perform global reclaim.

The default is 5 percent.

Note that slab reclaim is triggered in a per zone / node fashion. The process of reclaiming slab memory is currently not node specific and may not be fast.

<a id="rst-min-unmapped-ratio"></a>

## min_unmapped_ratio

This is available only on NUMA kernels.

This is a percentage of the total pages in each zone. Zone reclaim will only occur if more than this percentage of pages are in a state that zone_reclaim_mode allows to be reclaimed.

If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared against all file-backed unmapped pages including swapcache pages and tmpfs files. Otherwise, only unmapped pages backed by normal files but not tmpfs files and similar are considered.

The default is 1 percent.

<a id="rst-mmap-min-addr"></a>

## mmap_min_addr

This file indicates the amount of address space  which a user process will be restricted from mmapping.  Since kernel null dereference bugs could accidentally operate based on the information in the first couple of pages of memory userspace processes should not be allowed to write to them.  By default this value is set to 0 and no protections will be enforced by the security module.  Setting this value to something like 64k will allow the vast majority of applications to work correctly and provide defense in depth against future potential kernel bugs.

<a id="rst-mmap-rnd-bits"></a>

## mmap_rnd_bits

This value can be used to select the number of bits to use to determine the random offset to the base address of vma regions resulting from mmap allocations on architectures which support tuning address space randomization.  This value will be bounded by the architecture's minimum and maximum supported values.

This value can be changed after boot using the /proc/sys/vm/mmap_rnd_bits tunable

<a id="rst-mmap-rnd-compat-bits"></a>

## mmap_rnd_compat_bits

This value can be used to select the number of bits to use to determine the random offset to the base address of vma regions resulting from mmap allocations for applications run in compatibility mode on architectures which support tuning address space randomization.  This value will be bounded by the architecture's minimum and maximum supported values.

This value can be changed after boot using the /proc/sys/vm/mmap_rnd_compat_bits tunable

<a id="rst-movable-gigantic-pages"></a>

## movable_gigantic_pages

This parameter controls whether gigantic pages may be allocated from ZONE_MOVABLE. If set to non-zero, gigantic pages can be allocated from ZONE_MOVABLE. ZONE_MOVABLE memory may be created via the kernel boot parameter `kernelcore` or via memory hotplug as discussed in [Documentation/admin-guide/mm/memory-hotplug.rst](/kernel/administration/admin-guide/mm/memory-hotplug.md).

Support may depend on specific architecture.

Note that using ZONE_MOVABLE gigantic pages make memory hotremove unreliable.

Memory hot-remove operations will block indefinitely until the admin reserves sufficient gigantic pages to service migration requests associated with the memory offlining process.  As HugeTLB gigantic page reservation is a manual process (via `nodeN/hugepages/.../nr_hugepages` interfaces) this may not be obvious when just attempting to offline a block of memory.

Additionally, as multiple gigantic pages may be reserved on a single block, it may appear that gigantic pages are available for migration when in reality they are in the process of being removed. For example if `memoryN` contains two gigantic pages, one reserved and one allocated, and an admin attempts to offline that block, this operations may hang indefinitely unless another reserved gigantic page is available on another block `memoryM`.

<a id="rst-nr-hugepages"></a>

## nr_hugepages

Change the minimum size of the hugepage pool.

See [Documentation/admin-guide/mm/hugetlbpage.rst](/kernel/administration/admin-guide/mm/hugetlbpage.md)

<a id="rst-hugetlb-optimize-vmemmap"></a>

## hugetlb_optimize_vmemmap

This knob is not available when the size of 'struct page' (a structure defined in include/linux/mm_types.h) is not power of two (an unusual system config could result in this).

Enable (set to 1) or disable (set to 0) HugeTLB Vmemmap Optimization (HVO).

Once enabled, the vmemmap pages of subsequent allocation of HugeTLB pages from buddy allocator will be optimized (7 pages per 2MB HugeTLB page and 4095 pages per 1GB HugeTLB page), whereas already allocated HugeTLB pages will not be optimized.  When those optimized HugeTLB pages are freed from the HugeTLB pool to the buddy allocator, the vmemmap pages representing that range needs to be remapped again and the vmemmap pages discarded earlier need to be rellocated again.  If your use case is that HugeTLB pages are allocated 'on the fly' (e.g. never explicitly allocating HugeTLB pages with 'nr_hugepages' but only set 'nr_overcommit_hugepages', those overcommitted HugeTLB pages are allocated 'on the fly') instead of being pulled from the HugeTLB pool, you should weigh the benefits of memory savings against the more overhead (\~2x slower than before) of allocation or freeing HugeTLB pages between the HugeTLB pool and the buddy allocator.  Another behavior to note is that if the system is under heavy memory pressure, it could prevent the user from freeing HugeTLB pages from the HugeTLB pool to the buddy allocator since the allocation of vmemmap pages could be failed, you have to retry later if your system encounter this situation.

Once disabled, the vmemmap pages of subsequent allocation of HugeTLB pages from buddy allocator will not be optimized meaning the extra overhead at allocation time from buddy allocator disappears, whereas already optimized HugeTLB pages will not be affected.  If you want to make sure there are no optimized HugeTLB pages, you can set "nr_hugepages" to 0 first and then disable this.  Note that writing 0 to nr_hugepages will make any "in use" HugeTLB pages become surplus pages.  So, those surplus pages are still optimized until they are no longer in use.  You would need to wait for those surplus pages to be released before there are no optimized pages in the system.

<a id="rst-nr-hugepages-mempolicy"></a>

## nr_hugepages_mempolicy

Change the size of the hugepage pool at run-time on a specific set of NUMA nodes.

See [Documentation/admin-guide/mm/hugetlbpage.rst](/kernel/administration/admin-guide/mm/hugetlbpage.md)

<a id="rst-nr-overcommit-hugepages"></a>

## nr_overcommit_hugepages

Change the maximum size of the hugepage pool. The maximum is nr_hugepages + nr_overcommit_hugepages.

See [Documentation/admin-guide/mm/hugetlbpage.rst](/kernel/administration/admin-guide/mm/hugetlbpage.md)

<a id="rst-nr-trim-pages"></a>

## nr_trim_pages

This is available only on NOMMU kernels.

This value adjusts the excess page trimming behaviour of power-of-2 aligned NOMMU mmap allocations.

A value of 0 disables trimming of allocations entirely, while a value of 1 trims excess pages aggressively. Any value &gt;= 1 acts as the watermark where trimming of allocations is initiated.

The default value is 1.

See [Documentation/admin-guide/mm/nommu-mmap.rst](/kernel/administration/admin-guide/mm/nommu-mmap.md) for more information.

<a id="rst-numa-zonelist-order"></a>

## numa_zonelist_order

This sysctl is only for NUMA and it is deprecated. Anything but Node order will fail\!

'where the memory is allocated from' is controlled by zonelists.

(This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation. you may be able to read ZONE_DMA as ZONE_DMA32...)

In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following. ZONE_NORMAL -&gt; ZONE_DMA This means that a memory allocation request for GFP_KERNEL will get memory from ZONE_DMA only when ZONE_NORMAL is not available.

In NUMA case, you can think of following 2 types of order. Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL:



```text
(A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL
(B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA.
```

Type(A) offers the best locality for processes on Node(0), but ZONE_DMA will be used before ZONE_NORMAL exhaustion. This increases possibility of out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small.

Type(B) cannot offer the best locality but is more robust against OOM of the DMA zone.

Type(A) is called as "Node" order. Type (B) is "Zone" order.

"Node order" orders the zonelists by node, then by zone within each node. Specify "\[Nn\]ode" for node order

"Zone Order" orders the zonelists by zone type, then by node within each zone.  Specify "\[Zz\]one" for zone order.

Specify "\[Dd\]efault" to request automatic configuration.

On 32-bit, the Normal zone needs to be preserved for allocations accessible by the kernel, so "zone" order will be selected.

On 64-bit, devices that require DMA32/DMA are relatively rare, so "node" order will be selected.

Default order is recommended unless this is causing problems for your system/application.

<a id="rst-oom-dump-tasks"></a>

## oom_dump_tasks

Enables a system-wide task dump (excluding kernel threads) to be produced when the kernel performs an OOM-killing and includes such information as pid, uid, tgid, vm size, rss, pgtables_bytes, swapents, oom_score_adj score, and name.  This is helpful to determine why the OOM killer was invoked, to identify the rogue task that caused it, and to determine why the OOM killer chose the task it did to kill.

If this is set to zero, this information is suppressed.  On very large systems with thousands of tasks it may not be feasible to dump the memory state information for each one.  Such systems should not be forced to incur a performance penalty in OOM conditions when the information may not be desired.

If this is set to non-zero, this information is shown whenever the OOM killer actually kills a memory-hogging task.

The default value is 1 (enabled).

<a id="rst-oom-kill-allocating-task"></a>

## oom_kill_allocating_task

This enables or disables killing the OOM-triggering task in out-of-memory situations.

If this is set to zero, the OOM killer will scan through the entire tasklist and select a task based on heuristics to kill.  This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed.

If this is set to non-zero, the OOM killer simply kills the task that triggered the out-of-memory condition.  This avoids the expensive tasklist scan.

If panic_on_oom is selected, it takes precedence over whatever value is used in oom_kill_allocating_task.

The default value is 0.

<a id="rst-overcommit-kbytes"></a>

## overcommit_kbytes

When overcommit_memory is set to 2, the committed address space is not permitted to exceed swap plus this amount of physical RAM. See below.

Note: overcommit_kbytes is the counterpart of overcommit_ratio. Only one of them may be specified at a time. Setting one disables the other (which then appears as 0 when read).

<a id="rst-overcommit-memory"></a>

## overcommit_memory

This value contains a flag that enables memory overcommitment.

When this flag is 0, the kernel compares the userspace memory request size against total memory plus swap and rejects obvious overcommits.

When this flag is 1, the kernel pretends there is always enough memory until it actually runs out.

When this flag is 2, the kernel uses a "never overcommit" policy that attempts to prevent any overcommit of memory. Note that user_reserve_kbytes affects this policy.

This feature can be very useful because there are a lot of programs that malloc() huge amounts of memory "just-in-case" and don't use much of it.

The default value is 0.

See [Documentation/mm/overcommit-accounting.rst](/kernel/internals/mm/overcommit-accounting.md) and mm/util.c::\__vm_enough_memory() for more information.

<a id="rst-overcommit-ratio"></a>

## overcommit_ratio

When overcommit_memory is set to 2, the committed address space is not permitted to exceed swap plus this percentage of physical RAM.  See above.

<a id="rst-page-cluster"></a>

## page-cluster

page-cluster controls the number of pages up to which consecutive pages are read in from swap in a single attempt. This is the swap counterpart to page cache readahead. The mentioned consecutivity is not in terms of virtual/physical addresses, but consecutive on swap space - that means they were swapped out together.

It is a logarithmic value - setting it to zero means "1 page", setting it to 1 means "2 pages", setting it to 2 means "4 pages", etc. Zero disables swap readahead completely.

The default value is three (eight pages at a time).  There may be some small benefits in tuning this to a different value if your workload is swap-intensive.

Lower values mean lower latencies for initial faults, but at the same time extra faults and I/O delays for following faults if they would have been part of that consecutive pages readahead would have brought in.

<a id="rst-page-lock-unfairness"></a>

## page_lock_unfairness

This value determines the number of times that the page lock can be stolen from under a waiter. After the lock is stolen the number of times specified in this file (default is 5), the "fair lock handoff" semantics will apply, and the waiter will only be awakened if the lock can be taken.

<a id="rst-panic-on-oom"></a>

## panic_on_oom

This enables or disables panic on out-of-memory feature.

If this is set to 0, the kernel will kill some rogue process, called oom_killer.  Usually, oom_killer can kill rogue processes and system will survive.

If this is set to 1, the kernel panics when out-of-memory happens. However, if a process limits using nodes by mempolicy/cpusets, and those nodes become memory exhaustion status, one process may be killed by oom-killer. No panic occurs in this case. Because other nodes' memory may be free. This means system total status may be not fatal yet.

If this is set to 2, the kernel panics compulsorily even on the above-mentioned. Even oom happens under memory cgroup, the whole system panics.

The default value is 0.

1 and 2 are for failover of clustering. Please select either according to your policy of failover.

panic_on_oom=2+kdump gives you very strong tool to investigate why oom happens. You can get snapshot.

<a id="rst-percpu-pagelist-high-fraction"></a>

## percpu_pagelist_high_fraction

This is the fraction of pages in each zone that are can be stored to per-cpu page lists. It is an upper boundary that is divided depending on the number of online CPUs. The min value for this is 8 which means that we do not allow more than 1/8th of pages in each zone to be stored on per-cpu page lists. This entry only changes the value of hot per-cpu page lists. A user can specify a number like 100 to allocate 1/100th of each zone between per-cpu lists.

The batch value of each per-cpu page list remains the same regardless of the value of the high fraction so allocation latencies are unaffected.

The initial value is zero. Kernel uses this value to set the high pcp-&gt;high mark based on the low watermark for the zone and the number of local online CPUs.  If the user writes '0' to this sysctl, it will revert to this default behavior.

<a id="rst-stat-interval"></a>

## stat_interval

The time interval between which vm statistics are updated.  The default is 1 second.

<a id="rst-stat-refresh"></a>

## stat_refresh

Any read or write (by root only) flushes all the per-cpu vm statistics into their global totals, for more accurate reports when testing e.g. cat /proc/sys/vm/stat_refresh /proc/meminfo

As a side-effect, it also checks for negative totals (elsewhere reported as 0) and "fails" with EINVAL if any are found, with a warning in dmesg. (At time of writing, a few stats are known sometimes to be found negative, with no ill effects: errors and warnings on these stats are suppressed.)

<a id="rst-numa-stat"></a>

## numa_stat

This interface allows runtime configuration of numa statistics.

When page allocation performance becomes a bottleneck and you can tolerate some possible tool breakage and decreased numa counter precision, you can do:



```text
echo 0 > /proc/sys/vm/numa_stat
```

When page allocation performance is not a bottleneck and you want all tooling to work, you can do:



```text
echo 1 > /proc/sys/vm/numa_stat
```

<a id="rst-swappiness"></a>

## swappiness

This control is used to define the rough relative IO cost of swapping and filesystem paging, as a value between 0 and 200. At 100, the VM assumes equal IO cost and will thus apply memory pressure to the page cache and swap-backed pages equally; lower values signify more expensive swap IO, higher values indicates cheaper.

Keep in mind that filesystem IO patterns under memory pressure tend to be more efficient than swap's random IO. An optimal value will require experimentation and will also be workload-dependent.

The default value is 60.

For in-memory swap, like zram or zswap, as well as hybrid setups that have swap on faster devices than the filesystem, values beyond 100 can be considered. For example, if the random IO against the swap device is on average 2x faster than IO from the filesystem, swappiness should be 133 (x + 2x = 200, 2x = 133.33).

At 0, the kernel will not initiate swap until the amount of free and file-backed pages is less than the high watermark in a zone.

<a id="rst-unprivileged-userfaultfd"></a>

## unprivileged_userfaultfd

This flag controls the mode in which unprivileged users can use the userfaultfd system calls. Set this to 0 to restrict unprivileged users to handle page faults in user mode only. In this case, users without SYS_CAP_PTRACE must pass UFFD_USER_MODE_ONLY in order for userfaultfd to succeed. Prohibiting use of userfaultfd for handling faults from kernel mode may make certain vulnerabilities more difficult to exploit.

Set this to 1 to allow unprivileged users to use the userfaultfd system calls without any restrictions.

The default value is 0.

Another way to control permissions for userfaultfd is to use /dev/userfaultfd instead of userfaultfd(2). See [Documentation/admin-guide/mm/userfaultfd.rst](/kernel/administration/admin-guide/mm/userfaultfd.md).

<a id="rst-user-reserve-kbytes"></a>

## user_reserve_kbytes

When overcommit_memory is set to 2, "never overcommit" mode, reserve min(3% of current process size, user_reserve_kbytes) of free memory. This is intended to prevent a user from starting a single memory hogging process, such that they cannot recover (kill the hog).

user_reserve_kbytes defaults to min(3% of the current process size, 128MB).

If this is reduced to zero, then the user will be allowed to allocate all free memory with a single process, minus admin_reserve_kbytes. Any subsequent attempts to execute a command will result in "fork: Cannot allocate memory".

Changing this takes effect whenever an application requests memory.

<a id="rst-vfs-cache-pressure"></a>

## vfs_cache_pressure

This percentage value controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects.

At the default value of vfs_cache_pressure=vfs_cache_pressure_denom the kernel will attempt to reclaim dentries and inodes at a "fair" rate with respect to pagecache and swapcache reclaim.  Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will never reclaim dentries and inodes due to memory pressure and this can easily lead to out-of-memory conditions. Increasing vfs_cache_pressure beyond vfs_cache_pressure_denom causes the kernel to prefer to reclaim dentries and inodes.

Increasing vfs_cache_pressure significantly beyond vfs_cache_pressure_denom may have negative performance impact. Reclaim code needs to take various locks to find freeable directory and inode objects. When vfs_cache_pressure equals (10 \* vfs_cache_pressure_denom), it will look for ten times more freeable objects than there are.

Note: This setting should always be used together with vfs_cache_pressure_denom.

<a id="rst-vfs-cache-pressure-denom"></a>

## vfs_cache_pressure_denom

Defaults to 100 (minimum allowed value). Requires corresponding vfs_cache_pressure setting to take effect.

<a id="rst-watermark-boost-factor"></a>

## watermark_boost_factor

This factor controls the level of reclaim when memory is being fragmented. It defines the percentage of the high watermark of a zone that will be reclaimed if pages of different mobility are being mixed within pageblocks. The intent is that compaction has less work to do in the future and to increase the success rate of future high-order allocations such as SLUB allocations, THP and hugetlbfs pages.

To make it sensible with respect to the watermark_scale_factor parameter, the unit is in fractions of 10,000. The default value of 15,000 means that up to 150% of the high watermark will be reclaimed in the event of a pageblock being mixed due to fragmentation. The level of reclaim is determined by the number of fragmentation events that occurred in the recent past. If this value is smaller than a pageblock then a pageblocks worth of pages will be reclaimed (e.g.  2MB on 64-bit x86). A boost factor of 0 will disable the feature.

<a id="rst-watermark-scale-factor"></a>

## watermark_scale_factor

This factor controls the aggressiveness of kswapd. It defines the amount of memory left in a node/system before kswapd is woken up and how much memory needs to be free before kswapd goes back to sleep.

The unit is in fractions of 10,000. The default value of 10 means the distances between watermarks are 0.1% of the available memory in the node/system. The maximum value is 3000, or 30% of memory.

A high rate of threads entering direct reclaim (allocstall) or kswapd going to sleep prematurely (kswapd_low_wmark_hit_quickly) can indicate that the number of free pages kswapd maintains for latency reasons is too small for the allocation bursts occurring in the system. This knob can then be used to tune kswapd aggressiveness accordingly.

<a id="rst-zone-reclaim-mode"></a>

## zone_reclaim_mode

Zone_reclaim_mode allows someone to set more or less aggressive approaches to reclaim memory when a zone runs out of memory. If it is set to zero then no zone reclaim occurs. Allocations will be satisfied from other zones / nodes in the system.

This is value OR'ed together of


<table>
<tbody>
<tr>
<td>


1

</td>
<td>


Zone reclaim on

</td>
</tr>
<tr>
<td>


2

</td>
<td>


Zone reclaim writes dirty pages out

</td>
</tr>
<tr>
<td>


4

</td>
<td>


Zone reclaim swaps pages

</td>
</tr>
</tbody>
</table>

zone_reclaim_mode is disabled by default.  For file servers or workloads that benefit from having their data cached, zone_reclaim_mode should be left disabled as the caching effect is likely to be more important than data locality.

Consider enabling one or more zone_reclaim mode bits if it's known that the workload is partitioned such that each partition fits within a NUMA node and that accessing remote memory would cause a measurable performance reduction.  The page allocator will take additional actions before allocating off node pages.

Allowing zone reclaim to write out pages stops processes that are writing large amounts of data from dirtying pages on other nodes. Zone reclaim will write out dirty pages if a zone fills up and so effectively throttle the process. This may decrease the performance of a single process since it cannot use all of system memory to buffer the outgoing writes anymore but it preserve the memory on other nodes so that the performance of other processes running on other nodes will not be affected.

Allowing regular swap effectively restricts allocations to the local node unless explicitly overridden by memory policies or cpuset configurations.
