[PATCH] powerpc/time: enable sched clock for irqtime

Pingfan Liu kernelfans at gmail.com
Thu Oct 22 17:51:19 AEDT 2020


When CONFIG_IRQ_TIME_ACCOUNTING and CONFIG_VIRT_CPU_ACCOUNTING_GEN, powerpc
does not enable "sched_clock_irqtime" and can not utilize irq time
accounting.

Like x86, powerpc does not use the sched_clock_register() interface. So it
needs an dedicated call to enable_sched_clock_irqtime() to enable irq time
accounting.

Signed-off-by: Pingfan Liu <kernelfans at gmail.com>
Cc: Michael Ellerman <mpe at ellerman.id.au>
Cc: Christophe Leroy <christophe.leroy at c-s.fr>
Cc: Nicholas Piggin <npiggin at gmail.com>
To: linuxppc-dev at lists.ozlabs.org
---
 arch/powerpc/kernel/time.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index f85539e..4083b59e 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -53,6 +53,7 @@
 #include <linux/of_clk.h>
 #include <linux/suspend.h>
 #include <linux/sched/cputime.h>
+#include <linux/sched/clock.h>
 #include <linux/processor.h>
 #include <asm/trace.h>
 
@@ -1134,6 +1135,7 @@ void __init time_init(void)
 	tick_setup_hrtimer_broadcast();
 
 	of_clk_init(NULL);
+	enable_sched_clock_irqtime();
 }
 
 /*
-- 
2.7.5



More information about the Linuxppc-dev mailing list