xref: /linux/init/Kconfig (revision 1b78070aaef63512688aebfbc82365ef9d6660f1)
1# SPDX-License-Identifier: GPL-2.0-only
2config CC_VERSION_TEXT
3	string
4	default "$(CC_VERSION_TEXT)"
5	help
6	  This is used in unclear ways:
7
8	  - Re-run Kconfig when the compiler is updated
9	    The 'default' property references the environment variable,
10	    CC_VERSION_TEXT so it is recorded in include/config/auto.conf.cmd.
11	    When the compiler is updated, Kconfig will be invoked.
12
13	  - Ensure full rebuild when the compiler is updated
14	    include/linux/compiler-version.h contains this option in the comment
15	    line so fixdep adds include/config/CC_VERSION_TEXT into the
16	    auto-generated dependency. When the compiler is updated, syncconfig
17	    will touch it and then every file will be rebuilt.
18
19config CC_IS_GCC
20	def_bool $(success,test "$(cc-name)" = GCC)
21
22config GCC_VERSION
23	int
24	default $(cc-version) if CC_IS_GCC
25	default 0
26
27config CC_IS_CLANG
28	def_bool $(success,test "$(cc-name)" = Clang)
29
30config CLANG_VERSION
31	int
32	default $(cc-version) if CC_IS_CLANG
33	default 0
34
35config AS_IS_GNU
36	def_bool $(success,test "$(as-name)" = GNU)
37
38config AS_IS_LLVM
39	def_bool $(success,test "$(as-name)" = LLVM)
40
41config AS_VERSION
42	int
43	# Use clang version if this is the integrated assembler
44	default CLANG_VERSION if AS_IS_LLVM
45	default $(as-version)
46
47config LD_IS_BFD
48	def_bool $(success,test "$(ld-name)" = BFD)
49
50config LD_VERSION
51	int
52	default $(ld-version) if LD_IS_BFD
53	default 0
54
55config LD_IS_LLD
56	def_bool $(success,test "$(ld-name)" = LLD)
57
58config LLD_VERSION
59	int
60	default $(ld-version) if LD_IS_LLD
61	default 0
62
63config RUSTC_VERSION
64	int
65	default $(rustc-version)
66	help
67	  It does not depend on `RUST` since that one may need to use the version
68	  in a `depends on`.
69
70config RUST_IS_AVAILABLE
71	def_bool $(success,$(srctree)/scripts/rust_is_available.sh)
72	help
73	  This shows whether a suitable Rust toolchain is available (found).
74
75	  Please see Documentation/rust/quick-start.rst for instructions on how
76	  to satisfy the build requirements of Rust support.
77
78	  In particular, the Makefile target 'rustavailable' is useful to check
79	  why the Rust toolchain is not being detected.
80
81config RUSTC_LLVM_VERSION
82	int
83	default $(rustc-llvm-version)
84
85config RUSTC_LLVM_MAJOR_VERSION
86	int
87	default $(shell,expr $(rustc-llvm-version) / 10000)
88
89config RUSTC_CLANG_LLVM_COMPATIBLE
90	bool
91	default y if CC_IS_CLANG && RUSTC_LLVM_MAJOR_VERSION = $(shell,expr $(cc-version) / 10000)
92	help
93	  This indicates whether Rust and Clang use LLVM of the same major
94	  version.
95
96	  Operations involving handling LLVM IR or bitcode (e.g. cross-language
97	  LTO) require the same LLVM major version to work properly. For best
98	  compatibility it is recommended that the exact same LLVM is used.
99
100config ARCH_HAS_CC_CAN_LINK
101	bool
102
103config CC_CAN_LINK
104	bool
105	default ARCH_CC_CAN_LINK if ARCH_HAS_CC_CAN_LINK
106	default $(cc_can_link_user,$(m64-flag)) if 64BIT
107	default $(cc_can_link_user,$(m32-flag))
108
109# Fixed in GCC 14, 13.3, 12.4 and 11.5
110# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
111config GCC_ASM_GOTO_OUTPUT_BROKEN
112	bool
113	depends on CC_IS_GCC
114	default y if GCC_VERSION < 110500
115	default y if GCC_VERSION >= 120000 && GCC_VERSION < 120400
116	default y if GCC_VERSION >= 130000 && GCC_VERSION < 130300
117
118config CC_HAS_ASM_GOTO_OUTPUT
119	def_bool y
120	depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
121	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
122
123config CC_HAS_ASM_GOTO_TIED_OUTPUT
124	depends on CC_HAS_ASM_GOTO_OUTPUT
125	# Detect buggy gcc and clang, fixed in gcc-11 clang-14.
126	def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null)
127
128config TOOLS_SUPPORT_RELR
129	def_bool $(success,env "CC=$(CC)" "LD=$(LD)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" $(srctree)/scripts/tools-support-relr.sh)
130
131config CC_HAS_ASM_INLINE
132	def_bool $(success,echo 'void foo(void) { asm inline (""); }' | $(CC) -x c - -c -o /dev/null)
133
134config CC_HAS_ASSUME
135	bool
136	# clang needs to be at least 19.1.0 since the meaning of the assume
137	# attribute changed:
138	# https://github.com/llvm/llvm-project/commit/c44fa3e8a9a44c2e9a575768a3c185354b9f6c17
139	default y if CC_IS_CLANG && CLANG_VERSION >= 190100
140	# supported since gcc 13.1.0
141	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106654
142	default y if CC_IS_GCC && GCC_VERSION >= 130100
143
144config CC_HAS_NO_PROFILE_FN_ATTR
145	def_bool $(success,echo '__attribute__((no_profile_instrument_function)) int x();' | $(CC) -x c - -c -o /dev/null -Werror)
146
147config CC_HAS_COUNTED_BY
148	bool
149	# clang needs to be at least 20.1.0 to avoid potential crashes
150	# when building structures that contain __counted_by
151	# https://github.com/ClangBuiltLinux/linux/issues/2114
152	# https://github.com/llvm/llvm-project/commit/160fb1121cdf703c3ef5e61fb26c5659eb581489
153	default y if CC_IS_CLANG && CLANG_VERSION >= 200100
154	# supported since gcc 15.1.0
155	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896
156	default y if CC_IS_GCC && GCC_VERSION >= 150100
157
158config CC_HAS_COUNTED_BY_PTR
159	bool
160	# supported since clang 22
161	default y if CC_IS_CLANG && CLANG_VERSION >= 220100
162	# supported since gcc 16.0.0
163	default y if CC_IS_GCC && GCC_VERSION >= 160000
164
165config CC_HAS_BROKEN_COUNTED_BY_REF
166	bool
167	# https://github.com/llvm/llvm-project/issues/182575
168	default y if CC_IS_CLANG && CLANG_VERSION < 220100
169
170config CC_HAS_ALLOC_TOKEN
171	def_bool $(cc-option,-falloc-token-max=123)
172
173config CC_HAS_MULTIDIMENSIONAL_NONSTRING
174	def_bool $(success,echo 'char tag[][4] __attribute__((__nonstring__)) = { };' | $(CC) $(CLANG_FLAGS) -x c - -c -o /dev/null -Werror)
175
176config LD_CAN_USE_KEEP_IN_OVERLAY
177	# ld.lld prior to 21.0.0 did not support KEEP within an overlay description
178	# https://github.com/llvm/llvm-project/pull/130661
179	def_bool LD_IS_BFD || LLD_VERSION >= 210000
180
181config RUSTC_HAS_SPAN_FILE
182	def_bool RUSTC_VERSION >= 108800
183
184config RUSTC_HAS_UNNECESSARY_TRANSMUTES
185	def_bool RUSTC_VERSION >= 108800
186
187config RUSTC_HAS_FILE_WITH_NUL
188	def_bool RUSTC_VERSION >= 108900
189
190config RUSTC_HAS_FILE_AS_C_STR
191	def_bool RUSTC_VERSION >= 109100
192
193config RUSTC_HAS_SUSPICIOUS_RUNTIME_SYMBOL_DEFINITIONS
194	def_bool RUSTC_VERSION >= 109800
195
196config PAHOLE_VERSION
197	int
198	default "$(PAHOLE_VERSION)"
199
200config CONSTRUCTORS
201	bool
202
203config IRQ_WORK
204	def_bool y if SMP
205
206config BUILDTIME_TABLE_SORT
207	bool
208
209config THREAD_INFO_IN_TASK
210	bool
211	help
212	  Select this to move thread_info off the stack into task_struct.  To
213	  make this work, an arch will need to remove all thread_info fields
214	  except flags and fix any runtime bugs.
215
216	  One subtle change that will be needed is to use try_get_task_stack()
217	  and put_task_stack() in save_thread_stack_tsk() and get_wchan().
218
219menu "General setup"
220
221config BROKEN
222	bool
223	help
224	  This option allows you to choose whether you want to try to
225	  compile (and fix) old drivers that haven't been updated to
226	  new infrastructure.
227
228config BROKEN_ON_SMP
229	bool
230	depends on BROKEN || !SMP
231	default y
232
233config INIT_ENV_ARG_LIMIT
234	int
235	default 32 if !UML
236	default 128 if UML
237	help
238	  Maximum of each of the number of arguments and environment
239	  variables passed to init from the kernel command line.
240
241config COMPILE_TEST
242	bool "Compile also drivers which will not load"
243	depends on HAS_IOMEM
244	help
245	  Some drivers can be compiled on a different platform than they are
246	  intended to be run on. Despite they cannot be loaded there (or even
247	  when they load they cannot be used due to missing HW support),
248	  developers still, opposing to distributors, might want to build such
249	  drivers to compile-test them.
250
251	  If you are a developer and want to build everything available, say Y
252	  here. If you are a user/distributor, say N here to exclude useless
253	  drivers to be distributed.
254
255config WERROR
256	bool "Compile the kernel with warnings as errors"
257	default COMPILE_TEST
258	help
259	  A kernel build should not cause any compiler warnings, and this
260	  enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
261	  to enforce that rule by default. Certain warnings from other tools
262	  such as the linker may be upgraded to errors with this option as
263	  well.
264
265	  However, if you have a new (or very old) compiler or linker with odd
266	  and unusual warnings, or you have some architecture with problems,
267	  you may need to disable this config option in order to
268	  successfully build the kernel.
269
270	  If in doubt, say Y.
271
272config UAPI_HEADER_TEST
273	bool "Compile test UAPI headers"
274	depends on HEADERS_INSTALL
275	help
276	  Compile test headers exported to user-space to ensure they are
277	  self-contained, i.e. compilable as standalone units.
278
279	  If you are a developer or tester and want to ensure the exported
280	  headers are self-contained, say Y here. Otherwise, choose N.
281
282config LOCALVERSION
283	string "Local version - append to kernel release"
284	help
285	  Append an extra string to the end of your kernel version.
286	  This will show up when you type uname, for example.
287	  The string you set here will be appended after the contents of
288	  any files with a filename matching localversion* in your
289	  object and source tree, in that order.  Your total string can
290	  be a maximum of 64 characters.
291
292config LOCALVERSION_AUTO
293	bool "Automatically append version information to the version string"
294	default y
295	depends on !COMPILE_TEST
296	help
297	  This will try to automatically determine if the current tree is a
298	  release tree by looking for git tags that belong to the current
299	  top of tree revision.
300
301	  A string of the format -gxxxxxxxx will be added to the localversion
302	  if a git-based tree is found.  The string generated by this will be
303	  appended after any matching localversion* files, and after the value
304	  set in CONFIG_LOCALVERSION.
305
306	  (The actual string used here is the first 12 characters produced
307	  by running the command:
308
309	    $ git rev-parse --verify HEAD
310
311	  which is done within the script "scripts/setlocalversion".)
312
313config BUILD_SALT
314	string "Build ID Salt"
315	default ""
316	help
317	  The build ID is used to link binaries and their debug info. Setting
318	  this option will use the value in the calculation of the build id.
319	  This is mostly useful for distributions which want to ensure the
320	  build is unique between builds. It's safe to leave the default.
321
322config HAVE_KERNEL_GZIP
323	bool
324
325config HAVE_KERNEL_BZIP2
326	bool
327
328config HAVE_KERNEL_LZMA
329	bool
330
331config HAVE_KERNEL_XZ
332	bool
333
334config HAVE_KERNEL_LZO
335	bool
336
337config HAVE_KERNEL_LZ4
338	bool
339
340config HAVE_KERNEL_ZSTD
341	bool
342
343config HAVE_KERNEL_UNCOMPRESSED
344	bool
345
346choice
347	prompt "Kernel compression mode"
348	default KERNEL_GZIP
349	depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_ZSTD || HAVE_KERNEL_UNCOMPRESSED
350	help
351	  The linux kernel is a kind of self-extracting executable.
352	  Several compression algorithms are available, which differ
353	  in efficiency, compression and decompression speed.
354	  Compression speed is only relevant when building a kernel.
355	  Decompression speed is relevant at each boot.
356
357	  If you have any problems with bzip2 or lzma compressed
358	  kernels, mail me (Alain Knaff) <alain@knaff.lu>. (An older
359	  version of this functionality (bzip2 only), for 2.4, was
360	  supplied by Christian Ludwig)
361
362	  High compression options are mostly useful for users, who
363	  are low on disk space (embedded systems), but for whom ram
364	  size matters less.
365
366	  If in doubt, select 'gzip'
367
368config KERNEL_GZIP
369	bool "Gzip"
370	depends on HAVE_KERNEL_GZIP
371	help
372	  The old and tried gzip compression. It provides a good balance
373	  between compression ratio and decompression speed.
374
375config KERNEL_BZIP2
376	bool "Bzip2"
377	depends on HAVE_KERNEL_BZIP2
378	help
379	  Its compression ratio and speed is intermediate.
380	  Decompression speed is slowest among the choices.  The kernel
381	  size is about 10% smaller with bzip2, in comparison to gzip.
382	  Bzip2 uses a large amount of memory. For modern kernels you
383	  will need at least 8MB RAM or more for booting.
384
385config KERNEL_LZMA
386	bool "LZMA"
387	depends on HAVE_KERNEL_LZMA
388	help
389	  This compression algorithm's ratio is best.  Decompression speed
390	  is between gzip and bzip2.  Compression is slowest.
391	  The kernel size is about 33% smaller with LZMA in comparison to gzip.
392
393config KERNEL_XZ
394	bool "XZ"
395	depends on HAVE_KERNEL_XZ
396	help
397	  XZ uses the LZMA2 algorithm and instruction set specific
398	  BCJ filters which can improve compression ratio of executable
399	  code. The size of the kernel is about 30% smaller with XZ in
400	  comparison to gzip. On architectures for which there is a BCJ
401	  filter (i386, x86_64, ARM, ARM64, RISC-V, big endian PowerPC,
402	  and SPARC), XZ will create a few percent smaller kernel than
403	  plain LZMA.
404
405	  The speed is about the same as with LZMA: The decompression
406	  speed of XZ is better than that of bzip2 but worse than gzip
407	  and LZO. Compression is slow.
408
409config KERNEL_LZO
410	bool "LZO"
411	depends on HAVE_KERNEL_LZO
412	help
413	  Its compression ratio is the poorest among the choices. The kernel
414	  size is about 10% bigger than gzip; however its speed
415	  (both compression and decompression) is the fastest.
416
417config KERNEL_LZ4
418	bool "LZ4"
419	depends on HAVE_KERNEL_LZ4
420	help
421	  LZ4 is an LZ77-type compressor with a fixed, byte-oriented encoding.
422	  A preliminary version of LZ4 de/compression tool is available at
423	  <https://code.google.com/p/lz4/>.
424
425	  Its compression ratio is worse than LZO. The size of the kernel
426	  is about 8% bigger than LZO. But the decompression speed is
427	  faster than LZO.
428
429config KERNEL_ZSTD
430	bool "ZSTD"
431	depends on HAVE_KERNEL_ZSTD
432	help
433	  ZSTD is a compression algorithm targeting intermediate compression
434	  with fast decompression speed. It will compress better than GZIP and
435	  decompress around the same speed as LZO, but slower than LZ4. You
436	  will need at least 192 KB RAM or more for booting. The zstd command
437	  line tool is required for compression.
438
439config KERNEL_UNCOMPRESSED
440	bool "None"
441	depends on HAVE_KERNEL_UNCOMPRESSED
442	help
443	  Produce uncompressed kernel image. This option is usually not what
444	  you want. It is useful for debugging the kernel in slow simulation
445	  environments, where decompressing and moving the kernel is awfully
446	  slow. This option allows early boot code to skip the decompressor
447	  and jump right at uncompressed kernel image.
448
449endchoice
450
451config DEFAULT_INIT
452	string "Default init path"
453	default ""
454	help
455	  This option determines the default init for the system if no init=
456	  option is passed on the kernel command line. If the requested path is
457	  not present, we will still then move on to attempting further
458	  locations (e.g. /sbin/init, etc). If this is empty, we will just use
459	  the fallback list when init= is not passed.
460
461config DEFAULT_HOSTNAME
462	string "Default hostname"
463	default "(none)"
464	help
465	  This option determines the default system hostname before userspace
466	  calls sethostname(2). The kernel traditionally uses "(none)" here,
467	  but you may wish to use a different default here to make a minimal
468	  system more usable with less configuration.
469
470config SYSVIPC
471	bool "System V IPC"
472	help
473	  Inter Process Communication is a suite of library functions and
474	  system calls which let processes (running programs) synchronize and
475	  exchange information. It is generally considered to be a good thing,
476	  and some programs won't run unless you say Y here. In particular, if
477	  you want to run the DOS emulator dosemu under Linux (read the
478	  DOSEMU-HOWTO, available from <http://www.tldp.org/docs.html#howto>),
479	  you'll need to say Y here.
480
481	  You can find documentation about IPC with "info ipc" and also in
482	  section 6.4 of the Linux Programmer's Guide, available from
483	  <http://www.tldp.org/guides.html>.
484
485config SYSVIPC_SYSCTL
486	bool
487	depends on SYSVIPC
488	depends on SYSCTL
489	default y
490
491config SYSVIPC_COMPAT
492	def_bool y
493	depends on COMPAT && SYSVIPC
494
495config POSIX_MQUEUE
496	bool "POSIX Message Queues"
497	depends on NET
498	help
499	  POSIX variant of message queues is a part of IPC. In POSIX message
500	  queues every message has a priority which decides about succession
501	  of receiving it by a process. If you want to compile and run
502	  programs written e.g. for Solaris with use of its POSIX message
503	  queues (functions mq_*) say Y here.
504
505	  POSIX message queues are visible as a filesystem called 'mqueue'
506	  and can be mounted somewhere if you want to do filesystem
507	  operations on message queues.
508
509	  If unsure, say Y.
510
511config POSIX_MQUEUE_SYSCTL
512	bool
513	depends on POSIX_MQUEUE
514	depends on SYSCTL
515	default y
516
517config WATCH_QUEUE
518	bool "General notification queue"
519	default n
520	help
521
522	  This is a general notification queue for the kernel to pass events to
523	  userspace by splicing them into pipes.  It can be used in conjunction
524	  with watches for key/keyring change notifications and device
525	  notifications.
526
527	  See Documentation/core-api/watch_queue.rst
528
529config CROSS_MEMORY_ATTACH
530	bool "Enable process_vm_readv/writev syscalls"
531	depends on MMU
532	default y
533	help
534	  Enabling this option adds the system calls process_vm_readv and
535	  process_vm_writev which allow a process with the correct privileges
536	  to directly read from or write to another process' address space.
537	  See the man page for more details.
538
539config AUDIT
540	bool "Auditing support"
541	depends on NET
542	help
543	  Enable auditing infrastructure that can be used with another
544	  kernel subsystem, such as SELinux (which requires this for
545	  logging of avc messages output).  System call auditing is included
546	  on architectures which support it.
547
548config HAVE_ARCH_AUDITSYSCALL
549	bool
550
551config AUDITSYSCALL
552	def_bool y
553	depends on AUDIT && HAVE_ARCH_AUDITSYSCALL
554	select FSNOTIFY
555
556source "kernel/irq/Kconfig"
557source "kernel/time/Kconfig"
558source "kernel/bpf/Kconfig"
559source "kernel/Kconfig.preempt"
560
561menu "CPU/Task time and stats accounting"
562
563config VIRT_CPU_ACCOUNTING
564	bool
565
566choice
567	prompt "Cputime accounting"
568	default VIRT_CPU_ACCOUNTING_GEN if NO_HZ_FULL
569	default TICK_CPU_ACCOUNTING
570
571# Kind of a stub config for the pure tick based cputime accounting
572config TICK_CPU_ACCOUNTING
573	bool "Simple tick based cputime accounting"
574	depends on !S390 && !NO_HZ_FULL
575	help
576	  This is the basic tick based cputime accounting that maintains
577	  statistics about user, system and idle time spent on per jiffies
578	  granularity.
579
580	  If unsure, say Y.
581
582config VIRT_CPU_ACCOUNTING_NATIVE
583	bool "Deterministic task and CPU time accounting"
584	depends on HAVE_VIRT_CPU_ACCOUNTING && !NO_HZ_FULL
585	select VIRT_CPU_ACCOUNTING
586	help
587	  Select this option to enable more accurate task and CPU time
588	  accounting.  This is done by reading a CPU counter on each
589	  kernel entry and exit and on transitions within the kernel
590	  between system, softirq and hardirq state, so there is a
591	  small performance impact.  In the case of s390 or IBM POWER > 5,
592	  this also enables accounting of stolen time on logically-partitioned
593	  systems.
594
595config VIRT_CPU_ACCOUNTING_GEN
596	bool "Full dynticks CPU time accounting"
597	depends on HAVE_CONTEXT_TRACKING_USER
598	depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
599	depends on GENERIC_CLOCKEVENTS
600	select VIRT_CPU_ACCOUNTING
601	select CONTEXT_TRACKING_USER
602	help
603	  Select this option to enable task and CPU time accounting on full
604	  dynticks systems. This accounting is implemented by watching every
605	  kernel-user boundaries using the context tracking subsystem.
606	  The accounting is thus performed at the expense of some significant
607	  overhead.
608
609	  For now this is only useful if you are working on the full
610	  dynticks subsystem development.
611
612	  If unsure, say N.
613
614endchoice
615
616config IRQ_TIME_ACCOUNTING
617	bool "Fine granularity task level IRQ time accounting"
618	depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
619	help
620	  Select this option to enable fine granularity task irq time
621	  accounting. This is done by reading a timestamp on each
622	  transitions between softirq and hardirq state, so there can be a
623	  small performance impact.
624
625	  If in doubt, say N here.
626
627config HAVE_SCHED_AVG_IRQ
628	def_bool y
629	depends on IRQ_TIME_ACCOUNTING || PARAVIRT_TIME_ACCOUNTING
630	depends on SMP
631
632config SCHED_HW_PRESSURE
633	bool
634	default y if ARM && ARM_CPU_TOPOLOGY
635	default y if ARM64
636	depends on SMP
637	depends on CPU_FREQ_THERMAL
638	help
639	  Select this option to enable HW pressure accounting in the
640	  scheduler. HW pressure is the value conveyed to the scheduler
641	  that reflects the reduction in CPU compute capacity resulted from
642	  HW throttling. HW throttling occurs when the performance of
643	  a CPU is capped due to high operating temperatures as an example.
644
645	  If selected, the scheduler will be able to balance tasks accordingly,
646	  i.e. put less load on throttled CPUs than on non/less throttled ones.
647
648	  This requires the architecture to implement
649	  arch_update_hw_pressure() and arch_scale_thermal_pressure().
650
651config BSD_PROCESS_ACCT
652	bool "BSD Process Accounting (DEPRECATED)"
653	depends on MULTIUSER
654	default n
655	help
656	  If you say Y here, a user level program will be able to instruct the
657	  kernel (via a special system call) to write process accounting
658	  information to a file: whenever a process exits, information about
659	  that process will be appended to the file by the kernel.  The
660	  information includes things such as creation time, owning user,
661	  command name, memory usage, controlling terminal etc. (the complete
662	  list is in the struct acct in <file:include/linux/acct.h>).  It is
663	  up to the user level program to do useful things with this
664	  information.  This mechanism is antiquated and has significant
665	  scalability issues.  You probably want to use eBPF instead.  Say
666	  N unless you really need this.
667
668config BSD_PROCESS_ACCT_V3
669	bool "BSD Process Accounting version 3 file format"
670	depends on BSD_PROCESS_ACCT
671	default n
672	help
673	  If you say Y here, the process accounting information is written
674	  in a new file format that also logs the process IDs of each
675	  process and its parent. Note that this file format is incompatible
676	  with previous v0/v1/v2 file formats, so you will need updated tools
677	  for processing it. A preliminary version of these tools is available
678	  at <http://www.gnu.org/software/acct/>.
679
680config TASKSTATS
681	bool "Export task/process statistics through netlink"
682	depends on NET
683	depends on MULTIUSER
684	default n
685	help
686	  Export selected statistics for tasks/processes through the
687	  generic netlink interface. Unlike BSD process accounting, the
688	  statistics are available during the lifetime of tasks/processes as
689	  responses to commands. Like BSD accounting, they are sent to user
690	  space on task exit.
691
692	  Say N if unsure.
693
694config TASK_DELAY_ACCT
695	bool "Enable per-task delay accounting"
696	depends on TASKSTATS
697	select SCHED_INFO
698	help
699	  Collect information on time spent by a task waiting for system
700	  resources like cpu, synchronous block I/O completion and swapping
701	  in pages. Such statistics can help in setting a task's priorities
702	  relative to other tasks for cpu, io, rss limits etc.
703
704	  Say N if unsure.
705
706config TASK_XACCT
707	bool "Enable extended accounting over taskstats"
708	depends on TASKSTATS
709	help
710	  Collect extended task accounting data and send the data
711	  to userland for processing over the taskstats interface.
712
713	  Say N if unsure.
714
715config TASK_IO_ACCOUNTING
716	bool "Enable per-task storage I/O accounting"
717	depends on TASK_XACCT
718	help
719	  Collect information on the number of bytes of storage I/O which this
720	  task has caused.
721
722	  Say N if unsure.
723
724config PSI
725	bool "Pressure stall information tracking"
726	select KERNFS
727	help
728	  Collect metrics that indicate how overcommitted the CPU, memory,
729	  and IO capacity are in the system.
730
731	  If you say Y here, the kernel will create /proc/pressure/ with the
732	  pressure statistics files cpu, memory, and io. These will indicate
733	  the share of walltime in which some or all tasks in the system are
734	  delayed due to contention of the respective resource.
735
736	  In kernels with cgroup support, cgroups (cgroup2 only) will
737	  have cpu.pressure, memory.pressure, and io.pressure files,
738	  which aggregate pressure stalls for the grouped tasks only.
739
740	  For more details see Documentation/accounting/psi.rst.
741
742	  Say N if unsure.
743
744config PSI_DEFAULT_DISABLED
745	bool "Require boot parameter to enable pressure stall information tracking"
746	default n
747	depends on PSI
748	help
749	  If set, pressure stall information tracking will be disabled
750	  per default but can be enabled through passing psi=1 on the
751	  kernel commandline during boot.
752
753	  This feature adds some code to the task wakeup and sleep
754	  paths of the scheduler. The overhead is too low to affect
755	  common scheduling-intense workloads in practice (such as
756	  webservers, memcache), but it does show up in artificial
757	  scheduler stress tests, such as hackbench.
758
759	  If you are paranoid and not sure what the kernel will be
760	  used for, say Y.
761
762	  Say N if unsure.
763
764endmenu # "CPU/Task time and stats accounting"
765
766config CPU_ISOLATION
767	bool "CPU isolation"
768	depends on SMP
769	default y
770	help
771	  Make sure that CPUs running critical tasks are not disturbed by
772	  any source of "noise" such as unbound workqueues, timers, kthreads...
773	  Unbound jobs get offloaded to housekeeping CPUs. This is driven by
774	  the "isolcpus=" boot parameter.
775
776	  Say Y if unsure.
777
778source "kernel/rcu/Kconfig"
779
780config IKCONFIG
781	tristate "Kernel .config support"
782	help
783	  This option enables the complete Linux kernel ".config" file
784	  contents to be saved in the kernel. It provides documentation
785	  of which kernel options are used in a running kernel or in an
786	  on-disk kernel.  This information can be extracted from the kernel
787	  image file with the script scripts/extract-ikconfig and used as
788	  input to rebuild the current kernel or to build another kernel.
789	  It can also be extracted from a running kernel by reading
790	  /proc/config.gz if enabled (below).
791
792config IKCONFIG_PROC
793	bool "Enable access to .config through /proc/config.gz"
794	depends on IKCONFIG && PROC_FS
795	help
796	  This option enables access to the kernel configuration file
797	  through /proc/config.gz.
798
799config IKHEADERS
800	tristate "Enable kernel headers through /sys/kernel/kheaders.tar.xz"
801	depends on SYSFS
802	help
803	  This option enables access to the in-kernel headers that are generated during
804	  the build process. These can be used to build eBPF tracing programs,
805	  or similar programs.  If you build the headers as a module, a module called
806	  kheaders.ko is built which can be loaded on-demand to get access to headers.
807
808config LOG_BUF_SHIFT
809	int "Kernel log buffer size (16 => 64KB, 17 => 128KB)"
810	range 12 25
811	default 17
812	depends on PRINTK
813	help
814	  Select the minimal kernel log buffer size as a power of 2.
815	  The final size is affected by LOG_CPU_MAX_BUF_SHIFT config
816	  parameter, see below. Any higher size also might be forced
817	  by "log_buf_len" boot parameter.
818
819	  Examples:
820		     17 => 128 KB
821		     16 => 64 KB
822		     15 => 32 KB
823		     14 => 16 KB
824		     13 =>  8 KB
825		     12 =>  4 KB
826
827config LOG_CPU_MAX_BUF_SHIFT
828	int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
829	depends on SMP
830	range 0 21
831	default 0 if BASE_SMALL
832	default 12
833	depends on PRINTK
834	help
835	  This option allows to increase the default ring buffer size
836	  according to the number of CPUs. The value defines the contribution
837	  of each CPU as a power of 2. The used space is typically only few
838	  lines however it might be much more when problems are reported,
839	  e.g. backtraces.
840
841	  The increased size means that a new buffer has to be allocated and
842	  the original static one is unused. It makes sense only on systems
843	  with more CPUs. Therefore this value is used only when the sum of
844	  contributions is greater than the half of the default kernel ring
845	  buffer as defined by LOG_BUF_SHIFT. The default values are set
846	  so that more than 16 CPUs are needed to trigger the allocation.
847
848	  Also this option is ignored when "log_buf_len" kernel parameter is
849	  used as it forces an exact (power of two) size of the ring buffer.
850
851	  The number of possible CPUs is used for this computation ignoring
852	  hotplugging making the computation optimal for the worst case
853	  scenario while allowing a simple algorithm to be used from bootup.
854
855	  Examples shift values and their meaning:
856		     17 => 128 KB for each CPU
857		     16 =>  64 KB for each CPU
858		     15 =>  32 KB for each CPU
859		     14 =>  16 KB for each CPU
860		     13 =>   8 KB for each CPU
861		     12 =>   4 KB for each CPU
862
863config PRINTK_INDEX
864	bool "Printk indexing debugfs interface"
865	depends on PRINTK && DEBUG_FS
866	help
867	  Add support for indexing of all printk formats known at compile time
868	  at <debugfs>/printk/index/<module>.
869
870	  This can be used as part of maintaining daemons which monitor
871	  /dev/kmsg, as it permits auditing the printk formats present in a
872	  kernel, allowing detection of cases where monitored printks are
873	  changed or no longer present.
874
875	  There is no additional runtime cost to printk with this enabled.
876
877#
878# Architectures with an unreliable sched_clock() should select this:
879#
880config HAVE_UNSTABLE_SCHED_CLOCK
881	bool
882
883config GENERIC_SCHED_CLOCK
884	bool
885
886menu "Scheduler features"
887
888config UCLAMP_TASK
889	bool "Enable utilization clamping for RT/FAIR tasks"
890	depends on CPU_FREQ_GOV_SCHEDUTIL
891	help
892	  This feature enables the scheduler to track the clamped utilization
893	  of each CPU based on RUNNABLE tasks scheduled on that CPU.
894
895	  With this option, the user can specify the min and max CPU
896	  utilization allowed for RUNNABLE tasks. The max utilization defines
897	  the maximum frequency a task should use while the min utilization
898	  defines the minimum frequency it should use.
899
900	  Both min and max utilization clamp values are hints to the scheduler,
901	  aiming at improving its frequency selection policy, but they do not
902	  enforce or grant any specific bandwidth for tasks.
903
904	  If in doubt, say N.
905
906config UCLAMP_BUCKETS_COUNT
907	int "Number of supported utilization clamp buckets"
908	range 5 20
909	default 5
910	depends on UCLAMP_TASK
911	help
912	  Defines the number of clamp buckets to use. The range of each bucket
913	  will be SCHED_CAPACITY_SCALE/UCLAMP_BUCKETS_COUNT. The higher the
914	  number of clamp buckets the finer their granularity and the higher
915	  the precision of clamping aggregation and tracking at run-time.
916
917	  For example, with the minimum configuration value we will have 5
918	  clamp buckets tracking 20% utilization each. A 25% boosted tasks will
919	  be refcounted in the [20..39]% bucket and will set the bucket clamp
920	  effective value to 25%.
921	  If a second 30% boosted task should be co-scheduled on the same CPU,
922	  that task will be refcounted in the same bucket of the first task and
923	  it will boost the bucket clamp effective value to 30%.
924	  The clamp effective value of a bucket is reset to its nominal value
925	  (20% in the example above) when there are no more tasks refcounted in
926	  that bucket.
927
928	  An additional boost/capping margin can be added to some tasks. In the
929	  example above the 25% task will be boosted to 30% until it exits the
930	  CPU. If that should be considered not acceptable on certain systems,
931	  it's always possible to reduce the margin by increasing the number of
932	  clamp buckets to trade off used memory for run-time tracking
933	  precision.
934
935	  If in doubt, use the default value.
936
937config SCHED_PROXY_EXEC
938	bool "Proxy Execution"
939	# Avoid some build failures w/ PREEMPT_RT until it can be fixed
940	depends on !PREEMPT_RT
941	# Need to investigate how to inform sched_ext of split contexts
942	depends on !SCHED_CLASS_EXT
943	# Not particularly useful until we get to multi-rq proxying
944	depends on EXPERT
945	help
946	  This option enables proxy execution, a mechanism for mutex-owning
947	  tasks to inherit the scheduling context of higher priority waiters.
948
949endmenu
950
951#
952# For architectures that support present-but-inaccessible (PROT_NONE) page
953# table entries detectable via pte_protnone() / pmd_protnone():
954#
955config ARCH_HAS_PTE_PROTNONE
956	bool
957
958#
959# For architectures that want to enable the support for NUMA-affine scheduler
960# balancing logic:
961#
962config ARCH_SUPPORTS_NUMA_BALANCING
963	bool
964
965#
966# For architectures that prefer to flush all TLBs after a number of pages
967# are unmapped instead of sending one IPI per page to flush. The architecture
968# must provide guarantees on what happens if a clean TLB cache entry is
969# written after the unmap. Details are in mm/rmap.c near the check for
970# should_defer_flush. The architecture should also consider if the full flush
971# and the refill costs are offset by the savings of sending fewer IPIs.
972config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
973	bool
974
975config CC_HAS_INT128
976	def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT
977
978config CC_IMPLICIT_FALLTHROUGH
979	string
980	default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5)
981	default "-Wimplicit-fallthrough" if CC_IS_CLANG && $(cc-option,-Wunreachable-code-fallthrough)
982
983config CC_MS_EXTENSIONS
984	string
985	default "-fms-anonymous-structs" if $(cc-option,-fms-anonymous-structs)
986	default "-fms-extensions"
987
988# Currently, disable gcc-10+ array-bounds globally.
989# It's still broken in gcc-13, so no upper bound yet.
990config GCC10_NO_ARRAY_BOUNDS
991	def_bool y
992
993config CC_NO_ARRAY_BOUNDS
994	bool
995	default y if CC_IS_GCC && GCC_VERSION >= 90000 && GCC10_NO_ARRAY_BOUNDS
996
997# Currently, disable -Wstringop-overflow for GCC globally.
998config GCC_NO_STRINGOP_OVERFLOW
999	def_bool y
1000
1001config CC_NO_STRINGOP_OVERFLOW
1002	bool
1003	default y if CC_IS_GCC && GCC_NO_STRINGOP_OVERFLOW
1004
1005config CC_STRINGOP_OVERFLOW
1006	bool
1007	default y if CC_IS_GCC && !CC_NO_STRINGOP_OVERFLOW
1008
1009#
1010# For architectures that know their GCC __int128 support is sound
1011#
1012config ARCH_SUPPORTS_INT128
1013	bool
1014
1015# For architectures that (ab)use NUMA to represent different memory regions
1016# all cpu-local but of different latencies, such as SuperH.
1017#
1018config ARCH_WANT_NUMA_VARIABLE_LOCALITY
1019	bool
1020
1021config NUMA_BALANCING
1022	bool "Memory placement aware NUMA scheduler"
1023	depends on ARCH_SUPPORTS_NUMA_BALANCING
1024	depends on ARCH_HAS_PTE_PROTNONE
1025	depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY
1026	depends on SMP && NUMA_MIGRATION && !PREEMPT_RT
1027	help
1028	  This option adds support for automatic NUMA aware memory/task placement.
1029	  The mechanism is quite primitive and is based on migrating memory when
1030	  it has references to the node the task is running on.
1031
1032	  This system will be inactive on UMA systems.
1033
1034config SCHED_CACHE
1035	bool "Cache aware load balance"
1036	default y
1037	depends on SMP
1038	help
1039	  When enabled, the scheduler will attempt to aggregate tasks from
1040	  the same process onto a single Last Level Cache (LLC) domain when
1041	  possible. This improves cache locality by keeping tasks that share
1042	  resources within the same cache domain, reducing cache misses and
1043	  lowering data access latency.
1044
1045config NUMA_BALANCING_DEFAULT_ENABLED
1046	bool "Automatically enable NUMA aware memory/task placement"
1047	default y
1048	depends on NUMA_BALANCING
1049	help
1050	  If set, automatic NUMA balancing will be enabled if running on a NUMA
1051	  machine.
1052
1053config SLAB_OBJ_EXT
1054	bool
1055
1056menuconfig CGROUPS
1057	bool "Control Group support"
1058	select KERNFS
1059	help
1060	  This option adds support for grouping sets of processes together, for
1061	  use with process control subsystems such as Cpusets, CFS, memory
1062	  controls or device isolation.
1063	  See
1064		- Documentation/scheduler/sched-design-CFS.rst	(CFS)
1065		- Documentation/admin-guide/cgroup-v1/ (features for grouping, isolation
1066					  and resource control)
1067
1068	  Say N if unsure.
1069
1070if CGROUPS
1071
1072config PAGE_COUNTER
1073	bool
1074
1075config CGROUP_FAVOR_DYNMODS
1076	bool "Favor dynamic modification latency reduction by default"
1077	help
1078	  This option enables the "favordynmods" mount option by default
1079	  which reduces the latencies of dynamic cgroup modifications such
1080	  as task migrations and controller on/offs at the cost of making
1081	  hot path operations such as forks and exits more expensive.
1082
1083	  Say N if unsure.
1084
1085config MEMCG
1086	bool "Memory controller"
1087	select PAGE_COUNTER
1088	select EVENTFD
1089	select SLAB_OBJ_EXT
1090	select VM_EVENT_COUNTERS
1091	help
1092	  Provides control over the memory footprint of tasks in a cgroup.
1093
1094config MEMCG_NMI_UNSAFE
1095	bool
1096	depends on MEMCG
1097	depends on HAVE_NMI
1098	depends on !ARCH_HAS_NMI_SAFE_THIS_CPU_OPS && !ARCH_HAVE_NMI_SAFE_CMPXCHG
1099	default y
1100
1101config MEMCG_NMI_SAFETY_REQUIRES_ATOMIC
1102	bool
1103	depends on MEMCG
1104	depends on HAVE_NMI
1105	depends on !ARCH_HAS_NMI_SAFE_THIS_CPU_OPS && ARCH_HAVE_NMI_SAFE_CMPXCHG
1106	default y
1107
1108config MEMCG_V1
1109	bool "Legacy cgroup v1 memory controller"
1110	depends on MEMCG
1111	default n
1112	help
1113	  Legacy cgroup v1 memory controller which has been deprecated by
1114	  cgroup v2 implementation. The v1 is there for legacy applications
1115	  which haven't migrated to the new cgroup v2 interface yet. If you
1116	  do not have any such application then you are completely fine leaving
1117	  this option disabled.
1118
1119	  Please note that feature set of the legacy memory controller is likely
1120	  going to shrink due to deprecation process. New deployments with v1
1121	  controller are highly discouraged.
1122
1123	  Say N if unsure.
1124
1125config BLK_CGROUP
1126	bool "IO controller"
1127	depends on BLOCK
1128	default n
1129	help
1130	Generic block IO controller cgroup interface. This is the common
1131	cgroup interface which should be used by various IO controlling
1132	policies.
1133
1134	Currently, CFQ IO scheduler uses it to recognize task groups and
1135	control disk bandwidth allocation (proportional time slice allocation)
1136	to such task groups. It is also used by bio throttling logic in
1137	block layer to implement upper limit in IO rates on a device.
1138
1139	This option only enables generic Block IO controller infrastructure.
1140	One needs to also enable actual IO controlling logic/policy. For
1141	enabling proportional weight division of disk bandwidth in CFQ, set
1142	CONFIG_BFQ_GROUP_IOSCHED=y; for enabling throttling policy, set
1143	CONFIG_BLK_DEV_THROTTLING=y.
1144
1145	See Documentation/admin-guide/cgroup-v1/blkio-controller.rst for more information.
1146
1147config CGROUP_WRITEBACK
1148	bool
1149	depends on MEMCG && BLK_CGROUP
1150	default y
1151
1152menuconfig CGROUP_SCHED
1153	bool "CPU controller"
1154	default n
1155	help
1156	  This feature lets CPU scheduler recognize task groups and control CPU
1157	  bandwidth allocation to such task groups. It uses cgroups to group
1158	  tasks.
1159
1160if CGROUP_SCHED
1161config GROUP_SCHED_WEIGHT
1162	def_bool n
1163
1164config GROUP_SCHED_BANDWIDTH
1165	def_bool n
1166
1167config FAIR_GROUP_SCHED
1168	bool "Group scheduling for SCHED_OTHER"
1169	depends on CGROUP_SCHED
1170	select GROUP_SCHED_WEIGHT
1171	default CGROUP_SCHED
1172
1173config CFS_BANDWIDTH
1174	bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
1175	depends on FAIR_GROUP_SCHED
1176	select GROUP_SCHED_BANDWIDTH
1177	default n
1178	help
1179	  This option allows users to define CPU bandwidth rates (limits) for
1180	  tasks running within the fair group scheduler.  Groups with no limit
1181	  set are considered to be unconstrained and will run with no
1182	  restriction.
1183	  See Documentation/scheduler/sched-bwc.rst for more information.
1184
1185config RT_GROUP_SCHED
1186	bool "Group scheduling for SCHED_RR/FIFO"
1187	depends on CGROUP_SCHED
1188	default n
1189	help
1190	  This feature lets you explicitly allocate real CPU bandwidth
1191	  to task groups. If enabled, it will also make it impossible to
1192	  schedule realtime tasks for non-root users until you allocate
1193	  realtime bandwidth for them.
1194	  See Documentation/scheduler/sched-rt-group.rst for more information.
1195
1196config RT_GROUP_SCHED_DEFAULT_DISABLED
1197	bool "Require boot parameter to enable group scheduling for SCHED_RR/FIFO"
1198	depends on RT_GROUP_SCHED
1199	default n
1200	help
1201	  When set, the RT group scheduling is disabled by default. The option
1202	  is in inverted form so that mere RT_GROUP_SCHED enables the group
1203	  scheduling.
1204
1205	  Say N if unsure.
1206
1207config EXT_GROUP_SCHED
1208	bool
1209	depends on SCHED_CLASS_EXT && CGROUP_SCHED
1210	select GROUP_SCHED_WEIGHT
1211	select GROUP_SCHED_BANDWIDTH
1212	default y
1213
1214endif #CGROUP_SCHED
1215
1216config EXT_SUB_SCHED
1217        def_bool y
1218        depends on SCHED_CLASS_EXT && CGROUPS
1219
1220config SCHED_MM_CID
1221	def_bool y
1222	depends on SMP && RSEQ
1223
1224config UCLAMP_TASK_GROUP
1225	bool "Utilization clamping per group of tasks"
1226	depends on CGROUP_SCHED
1227	depends on UCLAMP_TASK
1228	default n
1229	help
1230	  This feature enables the scheduler to track the clamped utilization
1231	  of each CPU based on RUNNABLE tasks currently scheduled on that CPU.
1232
1233	  When this option is enabled, the user can specify a min and max
1234	  CPU bandwidth which is allowed for each single task in a group.
1235	  The max bandwidth allows to clamp the maximum frequency a task
1236	  can use, while the min bandwidth allows to define a minimum
1237	  frequency a task will always use.
1238
1239	  When task group based utilization clamping is enabled, an eventually
1240	  specified task-specific clamp value is constrained by the cgroup
1241	  specified clamp value. Both minimum and maximum task clamping cannot
1242	  be bigger than the corresponding clamping defined at task group level.
1243
1244	  If in doubt, say N.
1245
1246config CGROUP_PIDS
1247	bool "PIDs controller"
1248	help
1249	  Provides enforcement of process number limits in the scope of a
1250	  cgroup. Any attempt to fork more processes than is allowed in the
1251	  cgroup will fail. PIDs are fundamentally a global resource because it
1252	  is fairly trivial to reach PID exhaustion before you reach even a
1253	  conservative kmemcg limit. As a result, it is possible to grind a
1254	  system to halt without being limited by other cgroup policies. The
1255	  PIDs controller is designed to stop this from happening.
1256
1257	  It should be noted that organisational operations (such as attaching
1258	  to a cgroup hierarchy) will *not* be blocked by the PIDs controller,
1259	  since the PIDs limit only affects a process's ability to fork, not to
1260	  attach to a cgroup.
1261
1262config CGROUP_RDMA
1263	bool "RDMA controller"
1264	help
1265	  Provides enforcement of RDMA resources defined by IB stack.
1266	  It is fairly easy for consumers to exhaust RDMA resources, which
1267	  can result into resource unavailability to other consumers.
1268	  RDMA controller is designed to stop this from happening.
1269	  Attaching processes with active RDMA resources to the cgroup
1270	  hierarchy is allowed even if can cross the hierarchy's limit.
1271
1272config CGROUP_DMEM
1273	bool "Device memory controller (DMEM)"
1274	select PAGE_COUNTER
1275	help
1276	  The DMEM controller allows compatible devices to restrict device
1277	  memory usage based on the cgroup hierarchy.
1278
1279	  As an example, it allows you to restrict VRAM usage for applications
1280	  in the DRM subsystem.
1281
1282config CGROUP_FREEZER
1283	bool "Freezer controller"
1284	help
1285	  Provides a way to freeze and unfreeze all tasks in a
1286	  cgroup.
1287
1288	  This option affects the ORIGINAL cgroup interface. The cgroup2 memory
1289	  controller includes important in-kernel memory consumers per default.
1290
1291	  If you're using cgroup2, say N.
1292
1293config CGROUP_HUGETLB
1294	bool "HugeTLB controller"
1295	depends on HUGETLB_PAGE
1296	select PAGE_COUNTER
1297	default n
1298	help
1299	  Provides a cgroup controller for HugeTLB pages.
1300	  When you enable this, you can put a per cgroup limit on HugeTLB usage.
1301	  The limit is enforced during page fault. Since HugeTLB doesn't
1302	  support page reclaim, enforcing the limit at page fault time implies
1303	  that, the application will get SIGBUS signal if it tries to access
1304	  HugeTLB pages beyond its limit. This requires the application to know
1305	  beforehand how much HugeTLB pages it would require for its use. The
1306	  control group is tracked in the third page lru pointer. This means
1307	  that we cannot use the controller with huge page less than 3 pages.
1308
1309config CPUSETS
1310	bool "Cpuset controller"
1311	depends on SMP
1312	select UNION_FIND
1313	select CPU_ISOLATION
1314	help
1315	  This option will let you create and manage CPUSETs which
1316	  allow dynamically partitioning a system into sets of CPUs and
1317	  Memory Nodes and assigning tasks to run only within those sets.
1318	  This is primarily useful on large SMP or NUMA systems.
1319
1320	  Say N if unsure.
1321
1322config CPUSETS_V1
1323	bool "Legacy cgroup v1 cpusets controller"
1324	depends on CPUSETS
1325	default n
1326	help
1327	  Legacy cgroup v1 cpusets controller which has been deprecated by
1328	  cgroup v2 implementation. The v1 is there for legacy applications
1329	  which haven't migrated to the new cgroup v2 interface yet. Legacy
1330	  interface includes cpuset filesystem and /proc/<pid>/cpuset. If you
1331	  do not have any such application then you are completely fine leaving
1332	  this option disabled.
1333
1334	  Say N if unsure.
1335
1336config PROC_PID_CPUSET
1337	bool "Include legacy /proc/<pid>/cpuset file"
1338	depends on CPUSETS_V1
1339	default y
1340
1341config CGROUP_DEVICE
1342	bool "Device controller"
1343	help
1344	  Provides a cgroup controller implementing whitelists for
1345	  devices which a process in the cgroup can mknod or open.
1346
1347config CGROUP_CPUACCT
1348	bool "Simple CPU accounting controller"
1349	help
1350	  Provides a simple controller for monitoring the
1351	  total CPU consumed by the tasks in a cgroup.
1352
1353config CGROUP_PERF
1354	bool "Perf controller"
1355	depends on PERF_EVENTS
1356	help
1357	  This option extends the perf per-cpu mode to restrict monitoring
1358	  to threads which belong to the cgroup specified and run on the
1359	  designated cpu.  Or this can be used to have cgroup ID in samples
1360	  so that it can monitor performance events among cgroups.
1361
1362	  Say N if unsure.
1363
1364config CGROUP_BPF
1365	bool "Support for eBPF programs attached to cgroups"
1366	depends on BPF_SYSCALL
1367	select SOCK_CGROUP_DATA
1368	help
1369	  Allow attaching eBPF programs to a cgroup using the bpf(2)
1370	  syscall command BPF_PROG_ATTACH.
1371
1372	  In which context these programs are accessed depends on the type
1373	  of attachment. For instance, programs that are attached using
1374	  BPF_CGROUP_INET_INGRESS will be executed on the ingress path of
1375	  inet sockets.
1376
1377config CGROUP_MISC
1378	bool "Misc resource controller"
1379	default n
1380	help
1381	  Provides a controller for miscellaneous resources on a host.
1382
1383	  Miscellaneous scalar resources are the resources on the host system
1384	  which cannot be abstracted like the other cgroups. This controller
1385	  tracks and limits the miscellaneous resources used by a process
1386	  attached to a cgroup hierarchy.
1387
1388	  For more information, please check misc cgroup section in
1389	  /Documentation/admin-guide/cgroup-v2.rst.
1390
1391config CGROUP_DEBUG
1392	bool "Debug controller"
1393	default n
1394	depends on DEBUG_KERNEL
1395	help
1396	  This option enables a simple controller that exports
1397	  debugging information about the cgroups framework. This
1398	  controller is for control cgroup debugging only. Its
1399	  interfaces are not stable.
1400
1401	  Say N.
1402
1403config SOCK_CGROUP_DATA
1404	bool
1405	default n
1406
1407endif # CGROUPS
1408
1409menuconfig NAMESPACES
1410	bool "Namespaces support" if EXPERT
1411	depends on MULTIUSER
1412	default !EXPERT
1413	help
1414	  Provides the way to make tasks work with different objects using
1415	  the same id. For example same IPC id may refer to different objects
1416	  or same user id or pid may refer to different tasks when used in
1417	  different namespaces.
1418
1419if NAMESPACES
1420
1421config UTS_NS
1422	bool "UTS namespace"
1423	default y
1424	help
1425	  In this namespace tasks see different info provided with the
1426	  uname() system call
1427
1428config TIME_NS
1429	bool "TIME namespace"
1430	default y
1431	help
1432	  In this namespace boottime and monotonic clocks can be set.
1433	  The time will keep going with the same pace.
1434
1435config TIME_NS_VDSO
1436	def_bool TIME_NS && GENERIC_GETTIMEOFDAY
1437
1438config IPC_NS
1439	bool "IPC namespace"
1440	depends on (SYSVIPC || POSIX_MQUEUE)
1441	default y
1442	help
1443	  In this namespace tasks work with IPC ids which correspond to
1444	  different IPC objects in different namespaces.
1445
1446config USER_NS
1447	bool "User namespace"
1448	default n
1449	help
1450	  This allows containers, i.e. vservers, to use user namespaces
1451	  to provide different user info for different servers.
1452
1453	  When user namespaces are enabled in the kernel it is
1454	  recommended that the MEMCG option also be enabled and that
1455	  user-space use the memory control groups to limit the amount
1456	  of memory a memory unprivileged users can use.
1457
1458	  If unsure, say N.
1459
1460config PID_NS
1461	bool "PID Namespaces"
1462	default y
1463	help
1464	  Support process id namespaces.  This allows having multiple
1465	  processes with the same pid as long as they are in different
1466	  pid namespaces.  This is a building block of containers.
1467
1468config NET_NS
1469	bool "Network namespace"
1470	depends on NET
1471	default y
1472	help
1473	  Allow user space to create what appear to be multiple instances
1474	  of the network stack.
1475
1476endif # NAMESPACES
1477
1478config CHECKPOINT_RESTORE
1479	bool "Checkpoint/restore support"
1480	depends on PROC_FS
1481	select PROC_CHILDREN
1482	select KCMP
1483	default n
1484	help
1485	  Enables additional kernel features in a sake of checkpoint/restore.
1486	  In particular it adds auxiliary prctl codes to setup process text,
1487	  data and heap segment sizes, and a few additional /proc filesystem
1488	  entries.
1489
1490	  If unsure, say N here.
1491
1492config SCHED_AUTOGROUP
1493	bool "Automatic process group scheduling"
1494	select CGROUPS
1495	select CGROUP_SCHED
1496	select FAIR_GROUP_SCHED
1497	help
1498	  This option optimizes the scheduler for common desktop workloads by
1499	  automatically creating and populating task groups.  This separation
1500	  of workloads isolates aggressive CPU burners (like build jobs) from
1501	  desktop applications.  Task group autogeneration is currently based
1502	  upon task session.
1503
1504config RELAY
1505	bool "Kernel->user space relay support (formerly relayfs)"
1506	select IRQ_WORK
1507	help
1508	  This option enables support for relay interface support in
1509	  certain file systems (such as debugfs).
1510	  It is designed to provide an efficient mechanism for tools and
1511	  facilities to relay large amounts of data from kernel space to
1512	  user space.
1513
1514	  If unsure, say N.
1515
1516config BLK_DEV_INITRD
1517	bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
1518	help
1519	  The initial RAM filesystem is a ramfs which is loaded by the
1520	  boot loader (loadlin or lilo) and that is mounted as root
1521	  before the normal boot procedure. It is typically used to
1522	  load modules needed to mount the "real" root file system,
1523	  etc. See <file:Documentation/admin-guide/initrd.rst> for details.
1524
1525	  If RAM disk support (BLK_DEV_RAM) is also included, this
1526	  also enables initial RAM disk (initrd) support and adds
1527	  15 Kbytes (more on some other architectures) to the kernel size.
1528
1529	  If unsure say Y.
1530
1531if BLK_DEV_INITRD
1532
1533source "usr/Kconfig"
1534
1535endif
1536
1537config BOOT_CONFIG
1538	bool "Boot config support"
1539	select BLK_DEV_INITRD if !BOOT_CONFIG_EMBED
1540	help
1541	  Extra boot config allows system admin to pass a config file as
1542	  complemental extension of kernel cmdline when booting.
1543	  The boot config file must be attached at the end of initramfs
1544	  with checksum, size and magic word.
1545	  See <file:Documentation/admin-guide/bootconfig.rst> for details.
1546
1547	  If unsure, say Y.
1548
1549config BOOT_CONFIG_FORCE
1550	bool "Force unconditional bootconfig processing"
1551	depends on BOOT_CONFIG
1552	default y if BOOT_CONFIG_EMBED
1553	help
1554	  With this Kconfig option set, BOOT_CONFIG processing is carried
1555	  out even when the "bootconfig" kernel-boot parameter is omitted.
1556	  In fact, with this Kconfig option set, there is no way to
1557	  make the kernel ignore the BOOT_CONFIG-supplied kernel-boot
1558	  parameters.
1559
1560	  If unsure, say N.
1561
1562config BOOT_CONFIG_EMBED
1563	bool "Embed bootconfig file in the kernel"
1564	depends on BOOT_CONFIG
1565	help
1566	  Embed a bootconfig file given by BOOT_CONFIG_EMBED_FILE in the
1567	  kernel. Usually, the bootconfig file is loaded with the initrd
1568	  image. But if the system doesn't support initrd, this option will
1569	  help you by embedding a bootconfig file while building the kernel.
1570
1571	  If unsure, say N.
1572
1573config BOOT_CONFIG_EMBED_FILE
1574	string "Embedded bootconfig file path"
1575	depends on BOOT_CONFIG_EMBED
1576	help
1577	  Specify a bootconfig file which will be embedded to the kernel.
1578	  This bootconfig will be used if there is no initrd or no other
1579	  bootconfig in the initrd.
1580
1581config ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG
1582	bool
1583	help
1584	  Silent symbol; no C code reads it directly. Architectures
1585	  select it once their setup_arch() calls
1586	  xbc_prepend_embedded_cmdline() before parse_early_param().
1587	  Its only role is to gate the user-visible
1588	  CMDLINE_FROM_BOOTCONFIG option per-arch, the same
1589	  ARCH_SUPPORTS_* idiom used by ARCH_SUPPORTS_CFI, etc.
1590
1591config CMDLINE_FROM_BOOTCONFIG
1592	bool "Render embedded bootconfig as kernel cmdline at build time"
1593	depends on BOOT_CONFIG_EMBED_FILE != ""
1594	depends on ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG
1595	depends on CMDLINE = ""
1596	default n
1597	help
1598	  Render the "kernel" subtree of the embedded bootconfig file into a
1599	  flat cmdline string at kernel build time and prepend it to
1600	  boot_command_line during early architecture setup. This makes
1601	  early_param() handlers (e.g. mem=, earlycon=, loglevel=) see the
1602	  values supplied via the embedded bootconfig.
1603
1604	  The runtime bootconfig parser is unaffected, so tree-structured
1605	  consumers such as ftrace boot-time tracing keep working.
1606
1607	  Note: when an initrd also carries a bootconfig, its "kernel"
1608	  subtree is still parsed at runtime, but the embedded "kernel"
1609	  keys remain in boot_command_line for parse_early_param() and
1610	  end up later than the initrd keys in saved_command_line, so
1611	  parse_args() last-wins favors the embedded values. If you need
1612	  initrd to override embedded kernel.* keys, leave this option
1613	  off.
1614
1615	  If unsure, say N.
1616
1617config CMDLINE_LOG_WRAP_IDEAL_LEN
1618	int "Length to try to wrap the cmdline when logged at boot"
1619	default 1021
1620	range 0 1021
1621	help
1622	  At boot time, the kernel command line is logged to the console.
1623	  The log message will start with the prefix "Kernel command line: ".
1624	  The log message will attempt to be wrapped (split into multiple log
1625	  messages) at spaces based on CMDLINE_LOG_WRAP_IDEAL_LEN characters.
1626	  If wrapping happens, each log message will start with the prefix and
1627	  all but the last message will end with " \". Messages may exceed the
1628	  ideal length if a place to wrap isn't found before the specified
1629	  number of characters.
1630
1631	  A value of 0 disables wrapping, though be warned that the maximum
1632	  length of a log message (1021 characters) may cause the cmdline to
1633	  be truncated.
1634
1635config INITRAMFS_PRESERVE_MTIME
1636	bool "Preserve cpio archive mtimes in initramfs"
1637	depends on BLK_DEV_INITRD
1638	default y
1639	help
1640	  Each entry in an initramfs cpio archive carries an mtime value. When
1641	  enabled, extracted cpio items take this mtime, with directory mtime
1642	  setting deferred until after creation of any child entries.
1643
1644	  If unsure, say Y.
1645
1646config INITRAMFS_TEST
1647	bool "Test initramfs cpio archive extraction" if !KUNIT_ALL_TESTS
1648	depends on BLK_DEV_INITRD && KUNIT=y
1649	default KUNIT_ALL_TESTS
1650	help
1651	  Build KUnit tests for initramfs. See Documentation/dev-tools/kunit
1652
1653choice
1654	prompt "Compiler optimization level"
1655	default CC_OPTIMIZE_FOR_PERFORMANCE
1656
1657config CC_OPTIMIZE_FOR_PERFORMANCE
1658	bool "Optimize for performance (-O2)"
1659	help
1660	  This is the default optimization level for the kernel, building
1661	  with the "-O2" compiler flag for best performance and most
1662	  helpful compile-time warnings.
1663
1664config CC_OPTIMIZE_FOR_SIZE
1665	bool "Optimize for size (-Os)"
1666	help
1667	  Choosing this option will pass "-Os" to your compiler resulting
1668	  in a smaller kernel.
1669
1670endchoice
1671
1672config HAVE_LD_DEAD_CODE_DATA_ELIMINATION
1673	bool
1674	help
1675	  This requires that the arch annotates or otherwise protects
1676	  its external entry points from being discarded. Linker scripts
1677	  must also merge .text.*, .data.*, and .bss.* correctly into
1678	  output sections. Care must be taken not to pull in unrelated
1679	  sections (e.g., '.text.init'). Typically '.' in section names
1680	  is used to distinguish them from label names / C identifiers.
1681
1682config LD_DEAD_CODE_DATA_ELIMINATION
1683	bool "Dead code and data elimination (EXPERIMENTAL)"
1684	depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION
1685	depends on EXPERT
1686	depends on $(cc-option,-ffunction-sections -fdata-sections)
1687	depends on $(ld-option,--gc-sections)
1688	help
1689	  Enable this if you want to do dead code and data elimination with
1690	  the linker by compiling with -ffunction-sections -fdata-sections,
1691	  and linking with --gc-sections.
1692
1693	  This can reduce on disk and in-memory size of the kernel
1694	  code and static data, particularly for small configs and
1695	  on small systems. This has the possibility of introducing
1696	  silently broken kernel if the required annotations are not
1697	  present. This option is not well tested yet, so use at your
1698	  own risk.
1699
1700config LD_ORPHAN_WARN
1701	def_bool y
1702	depends on ARCH_WANT_LD_ORPHAN_WARN
1703	depends on $(ld-option,--orphan-handling=warn)
1704	depends on $(ld-option,--orphan-handling=error)
1705
1706config LD_ORPHAN_WARN_LEVEL
1707	string
1708	depends on LD_ORPHAN_WARN
1709	default "error" if WERROR
1710	default "warn"
1711
1712config HAVE_UID16
1713	bool
1714
1715config SYSCTL_EXCEPTION_TRACE
1716	bool
1717	help
1718	  Enable support for /proc/sys/debug/exception-trace.
1719
1720config SYSCTL_ARCH_UNALIGN_NO_WARN
1721	bool
1722	help
1723	  Enable support for /proc/sys/kernel/ignore-unaligned-usertrap
1724	  Allows arch to define/use @no_unaligned_warning to possibly warn
1725	  about unaligned access emulation going on under the hood.
1726
1727config SYSCTL_ARCH_UNALIGN_ALLOW
1728	bool
1729	help
1730	  Enable support for /proc/sys/kernel/unaligned-trap
1731	  Allows arches to define/use @unaligned_enabled to runtime toggle
1732	  the unaligned access emulation.
1733	  see arch/parisc/kernel/unaligned.c for reference
1734
1735config SYSFS_SYSCALL
1736	bool "Sysfs syscall support"
1737	default n
1738	help
1739	  sys_sysfs is an obsolete system call no longer supported in libc.
1740	  Note that disabling this option is more secure but might break
1741	  compatibility with some systems.
1742
1743	  If unsure say N here.
1744
1745config HAVE_PCSPKR_PLATFORM
1746	bool
1747
1748menuconfig EXPERT
1749	bool "Configure standard kernel features (expert users)"
1750	# Unhide debug options, to make the on-by-default options visible
1751	select DEBUG_KERNEL
1752	help
1753	  This option allows certain base kernel options and settings
1754	  to be disabled or tweaked. This is for specialized
1755	  environments which can tolerate a "non-standard" kernel.
1756	  Only use this if you really know what you are doing.
1757
1758config UID16
1759	bool "Enable 16-bit UID system calls" if EXPERT
1760	depends on HAVE_UID16 && MULTIUSER
1761	default y
1762	help
1763	  This enables the legacy 16-bit UID syscall wrappers.
1764
1765config MULTIUSER
1766	bool "Multiple users, groups and capabilities support" if EXPERT
1767	default y
1768	help
1769	  This option enables support for non-root users, groups and
1770	  capabilities.
1771
1772	  If you say N here, all processes will run with UID 0, GID 0, and all
1773	  possible capabilities.  Saying N here also compiles out support for
1774	  system calls related to UIDs, GIDs, and capabilities, such as setuid,
1775	  setgid, and capset.
1776
1777	  If unsure, say Y here.
1778
1779config SGETMASK_SYSCALL
1780	bool "sgetmask/ssetmask syscalls support" if EXPERT
1781	default PARISC || M68K || PPC || MIPS || X86 || SPARC || MICROBLAZE || SUPERH
1782	help
1783	  sys_sgetmask and sys_ssetmask are obsolete system calls
1784	  no longer supported in libc but still enabled by default in some
1785	  architectures.
1786
1787	  If unsure, leave the default option here.
1788
1789config FHANDLE
1790	bool "open by fhandle syscalls" if EXPERT
1791	select EXPORTFS
1792	default y
1793	help
1794	  If you say Y here, a user level program will be able to map
1795	  file names to handle and then later use the handle for
1796	  different file system operations. This is useful in implementing
1797	  userspace file servers, which now track files using handles instead
1798	  of names. The handle would remain the same even if file names
1799	  get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
1800	  syscalls.
1801
1802config POSIX_TIMERS
1803	bool "Posix Clocks & timers" if EXPERT
1804	default y
1805	help
1806	  This includes native support for POSIX timers to the kernel.
1807	  Some embedded systems have no use for them and therefore they
1808	  can be configured out to reduce the size of the kernel image.
1809
1810	  When this option is disabled, the following syscalls won't be
1811	  available: timer_create, timer_gettime: timer_getoverrun,
1812	  timer_settime, timer_delete, clock_adjtime, getitimer,
1813	  setitimer, alarm. Furthermore, the clock_settime, clock_gettime,
1814	  clock_getres and clock_nanosleep syscalls will be limited to
1815	  CLOCK_REALTIME, CLOCK_MONOTONIC and CLOCK_BOOTTIME only.
1816
1817	  If unsure say y.
1818
1819config PRINTK
1820	default y
1821	bool "Enable support for printk" if EXPERT
1822	select IRQ_WORK
1823	help
1824	  This option enables normal printk support. Removing it
1825	  eliminates most of the message strings from the kernel image
1826	  and makes the kernel more or less silent. As this makes it
1827	  very difficult to diagnose system problems, saying N here is
1828	  strongly discouraged.
1829
1830config PRINTK_RINGBUFFER_KUNIT_TEST
1831	tristate "KUnit Test for the printk ringbuffer" if !KUNIT_ALL_TESTS
1832	depends on PRINTK && KUNIT
1833	default KUNIT_ALL_TESTS
1834	help
1835	  This builds the printk ringbuffer KUnit test suite.
1836
1837	  For more information on KUnit and unit tests in general, please refer
1838	  to the KUnit documentation.
1839
1840	  If unsure, say N.
1841
1842config BUG
1843	bool "BUG() support" if EXPERT
1844	default y
1845	help
1846	  Disabling this option eliminates support for BUG and WARN, reducing
1847	  the size of your kernel image and potentially quietly ignoring
1848	  numerous fatal conditions. You should only consider disabling this
1849	  option for embedded systems with no facilities for reporting errors.
1850	  Just say Y.
1851
1852config ELF_CORE
1853	depends on COREDUMP
1854	default y
1855	bool "Enable ELF core dumps" if EXPERT
1856	help
1857	  Enable support for generating core dumps. Disabling saves about 4k.
1858
1859
1860config PCSPKR_PLATFORM
1861	bool "Enable PC-Speaker support" if EXPERT
1862	depends on HAVE_PCSPKR_PLATFORM
1863	select I8253_LOCK
1864	default y
1865	help
1866	  This option allows to disable the internal PC-Speaker
1867	  support, saving some memory.
1868
1869config BASE_SMALL
1870	bool "Enable smaller-sized data structures for core" if EXPERT
1871	help
1872	  Enabling this option reduces the size of miscellaneous core
1873	  kernel data structures. This saves memory on small machines,
1874	  but may reduce performance.
1875
1876config FUTEX
1877	bool "Enable futex support" if EXPERT
1878	depends on !(SPARC32 && SMP)
1879	default y
1880	imply RT_MUTEXES
1881	help
1882	  Disabling this option will cause the kernel to be built without
1883	  support for "fast userspace mutexes".  The resulting kernel may not
1884	  run glibc-based applications correctly.
1885
1886config FUTEX_PI
1887	bool
1888	depends on FUTEX && RT_MUTEXES
1889	default y
1890
1891config FUTEX_PRIVATE_HASH
1892	bool
1893	depends on FUTEX && !BASE_SMALL && MMU
1894	default y
1895
1896config FUTEX_MPOL
1897	bool
1898	depends on FUTEX && NUMA
1899	default y
1900
1901config HAVE_FUTEX_ROBUST_UNLOCK
1902	bool
1903
1904config FUTEX_ROBUST_UNLOCK
1905	def_bool FUTEX && GENERIC_IRQ_ENTRY && RSEQ && HAVE_FUTEX_ROBUST_UNLOCK
1906
1907config EPOLL
1908	bool "Enable eventpoll support" if EXPERT
1909	default y
1910	help
1911	  Disabling this option will cause the kernel to be built without
1912	  support for epoll family of system calls.
1913
1914config SIGNALFD
1915	bool "Enable signalfd() system call" if EXPERT
1916	default y
1917	help
1918	  Enable the signalfd() system call that allows to receive signals
1919	  on a file descriptor.
1920
1921	  If unsure, say Y.
1922
1923config TIMERFD
1924	bool "Enable timerfd() system call" if EXPERT
1925	default y
1926	help
1927	  Enable the timerfd() system call that allows to receive timer
1928	  events on a file descriptor.
1929
1930	  If unsure, say Y.
1931
1932config EVENTFD
1933	bool "Enable eventfd() system call" if EXPERT
1934	default y
1935	help
1936	  Enable the eventfd() system call that allows to receive both
1937	  kernel notification (ie. KAIO) or userspace notifications.
1938
1939	  If unsure, say Y.
1940
1941config SHMEM
1942	bool "Use full shmem filesystem" if EXPERT
1943	default y
1944	depends on MMU
1945	help
1946	  The shmem is an internal filesystem used to manage shared memory.
1947	  It is backed by swap and manages resource limits. It is also exported
1948	  to userspace as tmpfs if TMPFS is enabled. Disabling this
1949	  option replaces shmem and tmpfs with the much simpler ramfs code,
1950	  which may be appropriate on small systems without swap.
1951
1952config AIO
1953	bool "Enable AIO support" if EXPERT
1954	default y
1955	help
1956	  This option enables POSIX asynchronous I/O which may by used
1957	  by some high performance threaded applications. Disabling
1958	  this option saves about 7k.
1959
1960config IO_URING
1961	bool "Enable IO uring support" if EXPERT
1962	select IO_WQ
1963	default y
1964	help
1965	  This option enables support for the io_uring interface, enabling
1966	  applications to submit and complete IO through submission and
1967	  completion rings that are shared between the kernel and application.
1968
1969config GCOV_PROFILE_URING
1970	bool "Enable GCOV profiling on the io_uring subsystem"
1971	depends on IO_URING && GCOV_KERNEL
1972	help
1973	  Enable GCOV profiling on the io_uring subsystem, to facilitate
1974	  code coverage testing.
1975
1976	  If unsure, say N.
1977
1978	  Note that this will have a negative impact on the performance of
1979	  the io_uring subsystem, hence this should only be enabled for
1980	  specific test purposes.
1981
1982config IO_URING_MOCK_FILE
1983	tristate "Enable io_uring mock files (Experimental)" if EXPERT
1984	default n
1985	depends on IO_URING
1986	help
1987	  Enable mock files for io_uring subsystem testing. The ABI might
1988	  still change, so it's still experimental and should only be enabled
1989	  for specific test purposes.
1990
1991	  If unsure, say N.
1992
1993config ADVISE_SYSCALLS
1994	bool "Enable madvise/fadvise syscalls" if EXPERT
1995	default y
1996	help
1997	  This option enables the madvise and fadvise syscalls, used by
1998	  applications to advise the kernel about their future memory or file
1999	  usage, improving performance. If building an embedded system where no
2000	  applications use these syscalls, you can disable this option to save
2001	  space.
2002
2003config MEMBARRIER
2004	bool "Enable membarrier() system call" if EXPERT
2005	default y
2006	help
2007	  Enable the membarrier() system call that allows issuing memory
2008	  barriers across all running threads, which can be used to distribute
2009	  the cost of user-space memory barriers asymmetrically by transforming
2010	  pairs of memory barriers into pairs consisting of membarrier() and a
2011	  compiler barrier.
2012
2013	  If unsure, say Y.
2014
2015config KCMP
2016	bool "Enable kcmp() system call" if EXPERT
2017	help
2018	  Enable the kernel resource comparison system call. It provides
2019	  user-space with the ability to compare two processes to see if they
2020	  share a common resource, such as a file descriptor or even virtual
2021	  memory space.
2022
2023	  If unsure, say N.
2024
2025config RSEQ
2026	bool "Enable rseq() system call" if EXPERT
2027	default y
2028	depends on HAVE_RSEQ
2029	select MEMBARRIER
2030	help
2031	  Enable the restartable sequences system call. It provides a
2032	  user-space cache for the current CPU number value, which
2033	  speeds up getting the current CPU number from user-space,
2034	  as well as an ABI to speed up user-space operations on
2035	  per-CPU data.
2036
2037	  If unsure, say Y.
2038
2039config RSEQ_SLICE_EXTENSION
2040	bool "Enable rseq-based time slice extension mechanism"
2041	depends on RSEQ && HIGH_RES_TIMERS && GENERIC_ENTRY && HAVE_GENERIC_TIF_BITS
2042	help
2043	  Allows userspace to request a limited time slice extension when
2044	  returning from an interrupt to user space via the RSEQ shared
2045	  data ABI. If granted, that allows to complete a critical section,
2046	  so that other threads are not stuck on a conflicted resource,
2047	  while the task is scheduled out.
2048
2049	  If unsure, say N.
2050
2051config RSEQ_STATS
2052	default n
2053	bool "Enable lightweight statistics of restartable sequences" if EXPERT
2054	depends on RSEQ && DEBUG_FS
2055	help
2056	  Enable lightweight counters which expose information about the
2057	  frequency of RSEQ operations via debugfs. Mostly interesting for
2058	  kernel debugging or performance analysis. While lightweight it's
2059	  still adding code into the user/kernel mode transitions.
2060
2061	  If unsure, say N.
2062
2063config RSEQ_DEBUG_DEFAULT_ENABLE
2064	default n
2065	bool "Enable restartable sequences debug mode by default" if EXPERT
2066	depends on RSEQ
2067	help
2068	  This enables the static branch for debug mode of restartable
2069	  sequences.
2070
2071	  This also can be controlled on the kernel command line via the
2072	  command line parameter "rseq_debug=0/1" and through debugfs.
2073
2074	  If unsure, say N.
2075
2076config DEBUG_RSEQ
2077	default n
2078	bool "Enable debugging of rseq() system call" if EXPERT
2079	depends on RSEQ && DEBUG_KERNEL && !GENERIC_ENTRY
2080	select RSEQ_DEBUG_DEFAULT_ENABLE
2081	help
2082	  Enable extra debugging checks for the rseq system call.
2083
2084	  If unsure, say N.
2085
2086config CACHESTAT_SYSCALL
2087	bool "Enable cachestat() system call" if EXPERT
2088	default y
2089	help
2090	  Enable the cachestat system call, which queries the page cache
2091	  statistics of a file (number of cached pages, dirty pages,
2092	  pages marked for writeback, (recently) evicted pages).
2093
2094	  If unsure say Y here.
2095
2096config KALLSYMS
2097	bool "Load all symbols for debugging/ksymoops" if EXPERT
2098	default y
2099	help
2100	  Say Y here to let the kernel print out symbolic crash information and
2101	  symbolic stack backtraces. This increases the size of the kernel
2102	  somewhat, as all symbols have to be loaded into the kernel image.
2103
2104config KALLSYMS_SELFTEST
2105	bool "Test the basic functions and performance of kallsyms"
2106	depends on KALLSYMS
2107	default n
2108	help
2109	  Test the basic functions and performance of some interfaces, such as
2110	  kallsyms_lookup_name. It also calculates the compression rate of the
2111	  kallsyms compression algorithm for the current symbol set.
2112
2113	  Start self-test automatically after system startup. Suggest executing
2114	  "dmesg | grep kallsyms_selftest" to collect test results. "finish" is
2115	  displayed in the last line, indicating that the test is complete.
2116
2117config KALLSYMS_ALL
2118	bool "Include all symbols in kallsyms"
2119	depends on DEBUG_KERNEL && KALLSYMS
2120	help
2121	  Normally kallsyms only contains the symbols of functions for nicer
2122	  OOPS messages and backtraces (i.e., symbols from the text and inittext
2123	  sections). This is sufficient for most cases. And only if you want to
2124	  enable kernel live patching, or other less common use cases (e.g.,
2125	  when a debugger is used) all symbols are required (i.e., names of
2126	  variables from the data sections, etc).
2127
2128	  This option makes sure that all symbols are loaded into the kernel
2129	  image (i.e., symbols from all sections) in cost of increased kernel
2130	  size (depending on the kernel configuration, it may be 300KiB or
2131	  something like this).
2132
2133	  Say N unless you really need all symbols, or kernel live patching.
2134
2135# end of the "standard kernel features (expert users)" menu
2136
2137config ARCH_HAS_MEMBARRIER_CALLBACKS
2138	bool
2139
2140config ARCH_HAS_MEMBARRIER_SYNC_CORE
2141	bool
2142
2143config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
2144	bool
2145	help
2146	  Control MSEAL_SYSTEM_MAPPINGS access based on architecture.
2147
2148	  A 64-bit kernel is required for the memory sealing feature.
2149	  No specific hardware features from the CPU are needed.
2150
2151	  To enable this feature, the architecture needs to update their
2152	  special mappings calls to include the sealing flag and confirm
2153	  that it doesn't unmap/remap system mappings during the life
2154	  time of the process. The existence of this flag for an architecture
2155	  implies that it does not require the remapping of the system
2156	  mappings during process lifetime, so sealing these mappings is safe
2157	  from a kernel perspective.
2158
2159	  After the architecture enables this, a distribution can set
2160	  CONFIG_MSEAL_SYSTEM_MAPPINGS to manage access to the feature.
2161
2162	  For complete descriptions of memory sealing, please see
2163	  Documentation/userspace-api/mseal.rst
2164
2165config HAVE_PERF_EVENTS
2166	bool
2167	help
2168	  See tools/perf/design.txt for details.
2169
2170config GUEST_PERF_EVENTS
2171	bool
2172	depends on HAVE_PERF_EVENTS
2173
2174config PERF_GUEST_MEDIATED_PMU
2175	bool
2176	depends on GUEST_PERF_EVENTS
2177
2178config PERF_USE_VMALLOC
2179	bool
2180	help
2181	  See tools/perf/design.txt for details
2182
2183menu "Kernel Performance Events And Counters"
2184
2185config PERF_EVENTS
2186	bool "Kernel performance events and counters"
2187	default y if PROFILING
2188	depends on HAVE_PERF_EVENTS
2189	select IRQ_WORK
2190	help
2191	  Enable kernel support for various performance events provided
2192	  by software and hardware.
2193
2194	  Software events are supported either built-in or via the
2195	  use of generic tracepoints.
2196
2197	  Most modern CPUs support performance events via performance
2198	  counter registers. These registers count the number of certain
2199	  types of hw events: such as instructions executed, cachemisses
2200	  suffered, or branches mis-predicted - without slowing down the
2201	  kernel or applications. These registers can also trigger interrupts
2202	  when a threshold number of events have passed - and can thus be
2203	  used to profile the code that runs on that CPU.
2204
2205	  The Linux Performance Event subsystem provides an abstraction of
2206	  these software and hardware event capabilities, available via a
2207	  system call and used by the "perf" utility in tools/perf/. It
2208	  provides per task and per CPU counters, and it provides event
2209	  capabilities on top of those.
2210
2211	  Say Y if unsure.
2212
2213config DEBUG_PERF_USE_VMALLOC
2214	default n
2215	bool "Debug: use vmalloc to back perf mmap() buffers"
2216	depends on PERF_EVENTS && DEBUG_KERNEL && !PPC
2217	select PERF_USE_VMALLOC
2218	help
2219	  Use vmalloc memory to back perf mmap() buffers.
2220
2221	  Mostly useful for debugging the vmalloc code on platforms
2222	  that don't require it.
2223
2224	  Say N if unsure.
2225
2226endmenu
2227
2228config SYSTEM_DATA_VERIFICATION
2229	def_bool n
2230	select SYSTEM_TRUSTED_KEYRING
2231	select KEYS
2232	select CRYPTO
2233	select CRYPTO_RSA
2234	select ASYMMETRIC_KEY_TYPE
2235	select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
2236	select ASN1
2237	select OID_REGISTRY
2238	select X509_CERTIFICATE_PARSER
2239	select PKCS7_MESSAGE_PARSER
2240	help
2241	  Provide PKCS#7 message verification using the contents of the system
2242	  trusted keyring to provide public keys.  This then can be used for
2243	  module verification, kexec image verification and firmware blob
2244	  verification.
2245
2246config PROFILING
2247	bool "Profiling support"
2248	help
2249	  Say Y here to enable the extended profiling support mechanisms used
2250	  by profilers.
2251
2252config RUST
2253	bool "Rust support"
2254	depends on HAVE_RUST
2255	depends on RUST_IS_AVAILABLE
2256	select EXTENDED_MODVERSIONS if MODVERSIONS
2257	depends on !MODVERSIONS || GENDWARFKSYMS
2258	depends on !GCC_PLUGIN_RANDSTRUCT
2259	depends on !RANDSTRUCT
2260	depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO)
2261	depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
2262	select CFI_ICALL_NORMALIZE_INTEGERS if CFI
2263	depends on !KASAN || CC_IS_CLANG
2264	depends on !KASAN_SW_TAGS || RUSTC_VERSION >= 109600
2265	help
2266	  Enables Rust support in the kernel.
2267
2268	  This allows other Rust-related options, like drivers written in Rust,
2269	  to be selected.
2270
2271	  It is also required to be able to load external kernel modules
2272	  written in Rust.
2273
2274	  See Documentation/rust/ for more information.
2275
2276	  If unsure, say N.
2277
2278source "rust/kernel/Kconfig.test"
2279
2280config RUSTC_VERSION_TEXT
2281	string
2282	depends on RUST
2283	default "$(RUSTC_VERSION_TEXT)"
2284	help
2285	  See `CC_VERSION_TEXT`.
2286
2287config BINDGEN_VERSION_TEXT
2288	string
2289	depends on RUST
2290	default "$(shell,$(BINDGEN) --version 2>/dev/null)"
2291
2292#
2293# Place an empty function call at each tracepoint site. Can be
2294# dynamically changed for a probe function.
2295#
2296config TRACEPOINTS
2297	bool
2298	select TASKS_TRACE_RCU
2299
2300source "kernel/Kconfig.kexec"
2301
2302source "kernel/liveupdate/Kconfig"
2303
2304endmenu		# General setup
2305
2306source "arch/Kconfig"
2307
2308config RT_MUTEXES
2309	bool
2310	default y if PREEMPT_RT
2311
2312config MODULE_SIG_FORMAT
2313	def_bool n
2314	select SYSTEM_DATA_VERIFICATION
2315
2316source "kernel/module/Kconfig"
2317
2318config INIT_ALL_POSSIBLE
2319	bool
2320	help
2321	  Back when each arch used to define their own cpu_online_mask and
2322	  cpu_possible_mask, some of them chose to initialize cpu_possible_mask
2323	  with all 1s, and others with all 0s.  When they were centralised,
2324	  it was better to provide this option than to break all the archs
2325	  and have several arch maintainers pursuing me down dark alleys.
2326
2327source "block/Kconfig"
2328
2329config PREEMPT_NOTIFIERS
2330	bool
2331
2332config PADATA
2333	depends on SMP
2334	bool
2335
2336config ASN1
2337	tristate
2338	help
2339	  Build a simple ASN.1 grammar compiler that produces a bytecode output
2340	  that can be interpreted by the ASN.1 stream decoder and used to
2341	  inform it as to what tags are to be expected in a stream and what
2342	  functions to call on what tags.
2343
2344source "kernel/Kconfig.locks"
2345
2346config ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
2347	bool
2348
2349config ARCH_HAS_PREPARE_SYNC_CORE_CMD
2350	bool
2351
2352config ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
2353	bool
2354
2355# It may be useful for an architecture to override the definitions of the
2356# SYSCALL_DEFINE() and __SYSCALL_DEFINEx() macros in <linux/syscalls.h>
2357# and the COMPAT_ variants in <linux/compat.h>, in particular to use a
2358# different calling convention for syscalls. They can also override the
2359# macros for not-implemented syscalls in kernel/sys_ni.c and
2360# kernel/time/posix-stubs.c. All these overrides need to be available in
2361# <asm/syscall_wrapper.h>.
2362config ARCH_HAS_SYSCALL_WRAPPER
2363	def_bool n
2364