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