Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c58b0df1 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

nohz: Select VIRT_CPU_ACCOUNTING_GEN from full dynticks config



Turn the full dynticks passive dependency on VIRT_CPU_ACCOUNTING_GEN
to an active one.

The full dynticks Kconfig is currently hidden behind the full dynticks
cputime accounting, which is an awkward and counter-intuitive layout:
the user first has to select the dynticks cputime accounting in order
to make the full dynticks feature to be visible.

We definetly want it the other way around. The usual way to perform
this kind of active dependency is use "select" on the depended target.
Now we can't use the Kconfig "select" instruction when the target is
a "choice".

So this patch inspires on how the RCU subsystem Kconfig interact
with its dependencies on SMP and PREEMPT: we make sure that cputime
accounting can't propose another option than VIRT_CPU_ACCOUNTING_GEN
when NO_HZ_FULL is selected by using the right "depends on" instruction
for each cputime accounting choices.

v2: Keep full dynticks cputime accounting available even without
full dynticks, as per Paul McKenney's suggestion.

Reported-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
parent 65e709dc
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -306,7 +306,7 @@ choice
# Kind of a stub config for the pure tick based cputime accounting
# Kind of a stub config for the pure tick based cputime accounting
config TICK_CPU_ACCOUNTING
config TICK_CPU_ACCOUNTING
	bool "Simple tick based cputime accounting"
	bool "Simple tick based cputime accounting"
	depends on !S390
	depends on !S390 && !NO_HZ_FULL
	help
	help
	  This is the basic tick based cputime accounting that maintains
	  This is the basic tick based cputime accounting that maintains
	  statistics about user, system and idle time spent on per jiffies
	  statistics about user, system and idle time spent on per jiffies
@@ -316,7 +316,7 @@ config TICK_CPU_ACCOUNTING


config VIRT_CPU_ACCOUNTING_NATIVE
config VIRT_CPU_ACCOUNTING_NATIVE
	bool "Deterministic task and CPU time accounting"
	bool "Deterministic task and CPU time accounting"
	depends on HAVE_VIRT_CPU_ACCOUNTING
	depends on HAVE_VIRT_CPU_ACCOUNTING && !NO_HZ_FULL
	select VIRT_CPU_ACCOUNTING
	select VIRT_CPU_ACCOUNTING
	help
	help
	  Select this option to enable more accurate task and CPU time
	  Select this option to enable more accurate task and CPU time
@@ -346,7 +346,7 @@ config VIRT_CPU_ACCOUNTING_GEN


config IRQ_TIME_ACCOUNTING
config IRQ_TIME_ACCOUNTING
	bool "Fine granularity task level IRQ time accounting"
	bool "Fine granularity task level IRQ time accounting"
	depends on HAVE_IRQ_TIME_ACCOUNTING
	depends on HAVE_IRQ_TIME_ACCOUNTING && !NO_HZ_FULL
	help
	help
	  Select this option to enable fine granularity task irq time
	  Select this option to enable fine granularity task irq time
	  accounting. This is done by reading a timestamp on each
	  accounting. This is done by reading a timestamp on each
+3 −1
Original line number Original line Diff line number Diff line
@@ -104,11 +104,13 @@ config NO_HZ_FULL
	depends on SMP
	depends on SMP
	# RCU_USER_QS dependency
	# RCU_USER_QS dependency
	depends on HAVE_CONTEXT_TRACKING
	depends on HAVE_CONTEXT_TRACKING
	depends on VIRT_CPU_ACCOUNTING_GEN
	# VIRT_CPU_ACCOUNTING_GEN dependency
	depends on 64BIT
	select NO_HZ_COMMON
	select NO_HZ_COMMON
	select RCU_USER_QS
	select RCU_USER_QS
	select RCU_NOCB_CPU
	select RCU_NOCB_CPU
	select RCU_NOCB_CPU_ALL
	select RCU_NOCB_CPU_ALL
	select VIRT_CPU_ACCOUNTING_GEN
	select CONTEXT_TRACKING_FORCE
	select CONTEXT_TRACKING_FORCE
	select IRQ_WORK
	select IRQ_WORK
	help
	help