Skip to content

Commit cc60039

Browse files
hygoniakpm00
authored andcommitted
lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default
In workloads where this_cpu operations are frequently performed, enabling DEBUG_PREEMPT may result in significant increase in runtime overhead due to frequent invocation of __this_cpu_preempt_check() function. This can be demonstrated through benchmarks such as hackbench where this configuration results in a 10% reduction in performance, primarily due to the added overhead within memcg charging path. Therefore, do not to enable DEBUG_PREEMPT by default and make users aware of its potential impact on performance in some workloads. hackbench-process-sockets debug_preempt no_debug_preempt Amean 1 0.4743 ( 0.00%) 0.4295 * 9.45%* Amean 4 1.4191 ( 0.00%) 1.2650 * 10.86%* Amean 7 2.2677 ( 0.00%) 2.0094 * 11.39%* Amean 12 3.6821 ( 0.00%) 3.2115 * 12.78%* Amean 21 6.6752 ( 0.00%) 5.7956 * 13.18%* Amean 30 9.6646 ( 0.00%) 8.5197 * 11.85%* Amean 48 15.3363 ( 0.00%) 13.5559 * 11.61%* Amean 79 24.8603 ( 0.00%) 22.0597 * 11.27%* Amean 96 30.1240 ( 0.00%) 26.8073 * 11.01%* Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Hyeonggon Yoo <[email protected]> Acked-by: Roman Gushchin <[email protected]> Acked-by: Mel Gorman <[email protected]> Acked-by: Davidlohr Bueso <[email protected]> Cc: Ben Segall <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Daniel Bristot de Oliveira <[email protected]> Cc: David Rientjes <[email protected]> Cc: Dennis Zhou <[email protected]> Cc: Dietmar Eggemann <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Muchun Song <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Steven Rostedt (Google) <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Vincent Guittot <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f65c35d commit cc60039

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Kconfig.debug

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,13 +1246,16 @@ config DEBUG_TIMEKEEPING
12461246
config DEBUG_PREEMPT
12471247
bool "Debug preemptible kernel"
12481248
depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT
1249-
default y
12501249
help
12511250
If you say Y here then the kernel will use a debug variant of the
12521251
commonly used smp_processor_id() function and will print warnings
12531252
if kernel code uses it in a preemption-unsafe way. Also, the kernel
12541253
will detect preemption count underflows.
12551254

1255+
This option has potential to introduce high runtime overhead,
1256+
depending on workload as it triggers debugging routines for each
1257+
this_cpu operation. It should only be used for debugging purposes.
1258+
12561259
menu "Lock Debugging (spinlocks, mutexes, etc...)"
12571260

12581261
config LOCK_DEBUGGING_SUPPORT

0 commit comments

Comments
 (0)