kernel-parameters.rst 5.1 KB

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