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