Kernel parameters are key-value pairs passed to the Linux kernel at boot time. They control a wide range of behaviors: how much memory the kernel uses, which CPUs to bring online, how verbose logging is, and whether security mitigations are active. Understanding these parameters helps you tune performance, diagnose boot problems, and harden production systems.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DeelerDev/linux/llms.txt
Use this file to discover all available pages before exploring further.
How parameters are passed
Parameters are placed on the kernel command line, which the bootloader delivers to the kernel before control is handed off. On GRUB-based systems, they live in theGRUB_CMDLINE_LINUX or GRUB_CMDLINE_LINUX_DEFAULT variable in /etc/default/grub.
To add a parameter temporarily for a single boot, press e at the GRUB menu to edit the boot entry, append the parameter to the linux line, then press Ctrl+X to boot.
Viewing current parameters
The kernel exposes the active command line through/proc/cmdline:
Parameter names treat hyphens and underscores as equivalent.
log_buf_len=1M and log-buf-len=1M both work.Memory parameters
mem=nn[KMG]
mem=nn[KMG]
Limits the amount of RAM the kernel will use. Useful for testing low-memory behavior or working around buggy firmware that misreports memory.Values use binary multipliers:
K = 1024, M = 1048576, G = 1073741824.hugepages=N
hugepages=N
Allocates Each huge page is 2 MB on x86_64 by default. 512 pages reserves 1 GB for applications that use
N HugeTLB pages at boot time. Pre-allocating huge pages at boot is more reliable than runtime allocation because memory fragmentation has not yet occurred.MAP_HUGETLB (databases, JVMs with -XX:+UseLargePages).transparent_hugepage=
transparent_hugepage=
Controls the kernel’s transparent huge page (THP) behavior:
always— promote eligible anonymous mappings to 2 MB pages automaticallymadvise— only use THP for regions explicitly requested withmadvise(MADV_HUGEPAGE)never— disable THP entirely
madvise is a reasonable default for mixed workloads. Latency-sensitive applications (Redis, real-time audio) often benefit from never to avoid compaction stalls.CPU parameters
maxcpus=N
maxcpus=N
Limits the number of CPUs the kernel brings online at boot. Setting CPUs not brought online at boot can be enabled later:
maxcpus=1 produces a single-CPU kernel even on an SMP system, which is useful for reproducing race-condition bugs.isolcpus=
isolcpus=
Removes the listed CPUs from the general scheduler’s domain. Isolated CPUs will not run ordinary tasks unless explicitly assigned with
taskset or cgroup cpuset. Useful for real-time workloads and latency-sensitive applications.nohz_full=
nohz_full=
In kernels built with The boot CPU (CPU 0) is always excluded from
CONFIG_NO_HZ_FULL=y, stops the scheduler tick on the listed CPUs when only one task is running. This eliminates timer interrupt overhead for single-threaded compute tasks.nohz_full to maintain timekeeping. CPUs listed here also have their RCU callbacks offloaded automatically.Debug and logging parameters
loglevel=N
loglevel=N
Sets the default console log level. Messages with a priority lower than this number (i.e., less severe) are suppressed on the console. Levels range from 0 (emergency) to 7 (debug):
This can also be changed at runtime:
| Level | Name | Meaning |
|---|---|---|
| 0 | KERN_EMERG | System is unusable |
| 1 | KERN_ALERT | Action must be taken immediately |
| 2 | KERN_CRIT | Critical conditions |
| 3 | KERN_ERR | Error conditions |
| 4 | KERN_WARNING | Warning conditions |
| 5 | KERN_NOTICE | Normal but significant |
| 6 | KERN_INFO | Informational |
| 7 | KERN_DEBUG | Debug-level messages |
dmesg -n 7 or echo 7 > /proc/sys/kernel/printk.debug
debug
Enables kernel debugging, which sets the console log level to the maximum (
7) so all messages appear. Equivalent to loglevel=7 but also enables additional debug-level behavior in some subsystems.panic=N
panic=N
Controls the kernel’s behavior after a panic:Production servers typically use
panic=0— hang forever (default; useful for attaching a debugger)panic=N(N > 0) — reboot automatically after N secondspanic=-1— reboot immediately without delay
panic=1 combined with a watchdog so the system recovers automatically.oops=panic
oops=panic
Makes the kernel call Combine with
panic() whenever an oops occurs, instead of the default behavior of killing only the offending process. Useful on production systems where a partial failure is worse than a clean reboot.panic=30 to trigger a reboot after capturing a kdump.Security parameters
pti=
pti=
Controls Page Table Isolation (PTI), the Meltdown mitigation that separates user-space and kernel-space page tables:
pti=on— always enable (performance cost on pre-Meltdown CPUs)pti=off— always disable (not recommended on vulnerable hardware)pti=auto— enable only on CPUs known to be vulnerable (default)
nosmap / nosmep
nosmap / nosmep
Disables Supervisor Mode Access Prevention (
nosmap) or Supervisor Mode Execution Prevention (nosmep) on PowerPC. On x86, the equivalent options are controlled at compile time via CONFIG_X86_SMAP and CONFIG_X86_SMEP. Disabling these mitigations reduces security.noexec=
noexec=
On x86-64, controls whether the NX (No-Execute) page attribute is used to prevent code execution in data pages:
noexec=on— enforce NX (default)noexec=off— disable NX enforcement
I/O and filesystem parameters
rootfstype=
rootfstype=
Tells the kernel which filesystem type to use for the root filesystem. Normally the kernel detects this automatically, but setting it explicitly can speed up boot by skipping filesystem probing.
ro / rw
ro / rw
Controls whether the root filesystem is mounted read-only or read-write at boot:
ro— mount root read-only (default on most distributions;fsckruns before remounting read-write)rw— mount root read-write immediately, skipping the read-only phase
elevator=
elevator=
Selects the I/O scheduler for block devices. On modern kernels with You can also change the scheduler at runtime per device:
blk-mq, this affects multi-queue schedulers:none— no scheduling, pass-through to hardware queuemq-deadline— deadline scheduling for HDDskyber— low-latency scheduler for fast NVMe
Runtime tuning with sysctl
Many kernel behaviors that cannot be set via command-line parameters can be tuned at runtime throughsysctl, which reads and writes files under /proc/sys/:
| Namespace | Purpose |
|---|---|
kernel.* | Core kernel behavior (panic, printk, hostname) |
vm.* | Virtual memory (swappiness, dirty ratio, overcommit) |
net.* | Networking stack (TCP buffers, connection tracking) |
fs.* | Filesystem limits (file handles, inotify watches) |
