at commit 205cccd0
| 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | .. _kernelparameters: |
| 4 | |
| 5 | The kernel's command-line parameters |
| 6 | ==================================== |
| 7 | |
| 8 | The following is a consolidated list of the kernel parameters as implemented |
| 9 | by the __setup(), early_param(), core_param() and module_param() macros |
| 10 | and sorted into English Dictionary order (defined as ignoring all |
| 11 | punctuation and sorting digits before letters in a case insensitive |
| 12 | manner), and with descriptions where known. |
| 13 | |
| 14 | The kernel parses parameters from the kernel command line up to "``--``"; |
| 15 | if it doesn't recognize a parameter and it doesn't contain a '.', the |
| 16 | parameter gets passed to init: parameters with '=' go into init's |
| 17 | environment, others are passed as command line arguments to init. |
| 18 | Everything after "``--``" is passed as an argument to init. |
| 19 | |
| 20 | Module parameters can be specified in two ways: via the kernel command |
| 21 | line with a module name prefix, or via modprobe, e.g.:: |
| 22 | |
| 23 | (kernel command line) usbcore.blinkenlights=1 |
| 24 | (modprobe command line) modprobe usbcore blinkenlights=1 |
| 25 | |
| 26 | Parameters for modules which are built into the kernel need to be |
| 27 | specified on the kernel command line. modprobe looks through the |
| 28 | kernel command line (/proc/cmdline) and collects module parameters |
| 29 | when it loads a module, so the kernel command line can be used for |
| 30 | loadable modules too. |
| 31 | |
| 32 | This document may not be entirely up to date and comprehensive. The command |
| 33 | "modinfo -p ${modulename}" shows a current list of all parameters of a loadable |
| 34 | module. Loadable modules, after being loaded into the running kernel, also |
| 35 | reveal their parameters in /sys/module/${modulename}/parameters/. Some of these |
| 36 | parameters may be changed at runtime by the command |
| 37 | ``echo -n ${value} > /sys/module/${modulename}/parameters/${parm}``. |
| 38 | |
| 39 | Special handling |
| 40 | ---------------- |
| 41 | |
| 42 | Hyphens (dashes) and underscores are equivalent in parameter names, so:: |
| 43 | |
| 44 | log_buf_len=1M print-fatal-signals=1 |
| 45 | |
| 46 | can also be entered as:: |
| 47 | |
| 48 | log-buf-len=1M print_fatal_signals=1 |
| 49 | |
| 50 | Double-quotes can be used to protect spaces in values, e.g.:: |
| 51 | |
| 52 | param="spaces in here" |
| 53 | |
| 54 | cpu lists |
| 55 | ~~~~~~~~~ |
| 56 | |
| 57 | Some kernel parameters take a list of CPUs as a value, e.g. isolcpus, |
| 58 | nohz_full, irqaffinity, rcu_nocbs. The format of this list is: |
| 59 | |
| 60 | <cpu number>,...,<cpu number> |
| 61 | |
| 62 | or |
| 63 | |
| 64 | <cpu number>-<cpu number> |
| 65 | (must be a positive range in ascending order) |
| 66 | |
| 67 | or a mixture |
| 68 | |
| 69 | <cpu number>,...,<cpu number>-<cpu number> |
| 70 | |
| 71 | Note that for the special case of a range one can split the range into equal |
| 72 | sized groups and for each group use some amount from the beginning of that |
| 73 | group: |
| 74 | |
| 75 | <cpu number>-<cpu number>:<used size>/<group size> |
| 76 | |
| 77 | For example one can add to the command line following parameter: |
| 78 | |
| 79 | isolcpus=1,2,10-20,100-2000:2/25 |
| 80 | |
| 81 | where the final item represents CPUs 100,101,125,126,150,151,... |
| 82 | |
| 83 | The value "N" can be used to represent the numerically last CPU on the system, |
| 84 | i.e "foo_cpus=16-N" would be equivalent to "16-31" on a 32 core system. |
| 85 | |
| 86 | Keep in mind that "N" is dynamic, so if system changes cause the bitmap width |
| 87 | to change, such as less cores in the CPU list, then N and any ranges using N |
| 88 | will also change. Use the same on a small 4 core system, and "16-N" becomes |
| 89 | "16-3" and now the same boot input will be flagged as invalid (start > end). |
| 90 | |
| 91 | The special case-tolerant group name "all" has a meaning of selecting all CPUs, |
| 92 | so that "nohz_full=all" is the equivalent of "nohz_full=0-N". |
| 93 | |
| 94 | The semantics of "N" and "all" is supported on a level of bitmaps and holds for |
| 95 | all users of bitmap_parselist(). |
| 96 | |
| 97 | Metric suffixes |
| 98 | ~~~~~~~~~~~~~~~ |
| 99 | |
| 100 | The [KMG] suffix is commonly described after a number of kernel |
| 101 | parameter values. 'K', 'M', 'G', 'T', 'P', and 'E' suffixes are allowed. |
| 102 | These letters represent the _binary_ multipliers 'Kilo', 'Mega', 'Giga', |
| 103 | 'Tera', 'Peta', and 'Exa', equaling 2^10, 2^20, 2^30, 2^40, 2^50, and |
| 104 | 2^60 bytes respectively. Such letter suffixes can also be entirely omitted. |
| 105 | |
| 106 | Kernel Build Options |
| 107 | -------------------- |
| 108 | |
| 109 | The parameters listed below are only valid if certain kernel build options |
| 110 | were enabled and if respective hardware is present. This list should be kept |
| 111 | in alphabetical order. The text in square brackets at the beginning |
| 112 | of each description states the restrictions within which a parameter |
| 113 | is applicable. |
| 114 | |
| 115 | Parameters denoted with BOOT are actually interpreted by the boot |
| 116 | loader, and have no meaning to the kernel directly. |
| 117 | Do not modify the syntax of boot loader parameters without extreme |
| 118 | need or coordination with <Documentation/arch/x86/boot.rst>. |
| 119 | |
| 120 | There are also arch-specific kernel-parameters not documented here. |
| 121 | |
| 122 | Note that ALL kernel parameters listed below are CASE SENSITIVE, and that |
| 123 | a trailing = on the name of any parameter states that the parameter will |
| 124 | be entered as an environment variable, whereas its absence indicates that |
| 125 | it will appear as a kernel argument readable via /proc/cmdline by programs |
| 126 | running once the system is up. |
| 127 | |
| 128 | The number of kernel parameters is not limited, but the length of the |
| 129 | complete command line (parameters including spaces etc.) is limited to |
| 130 | a fixed number of characters. This limit depends on the architecture |
| 131 | and is between 256 and 4096 characters. It is defined in the file |
| 132 | ./include/uapi/asm-generic/setup.h as COMMAND_LINE_SIZE. |
| 133 | |
| 134 | .. include:: kernel-parameters.txt |
| 135 | :literal: |