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