powerpc/time: Enable sched clock for irqtime
authorPingfan Liu <kernelfans@gmail.com>
Thu, 22 Oct 2020 06:51:19 +0000 (14:51 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 31 Jan 2021 11:35:49 +0000 (22:35 +1100)
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.

Fixes: 518470fe962e ("powerpc: Add HAVE_IRQ_TIME_ACCOUNTING")
Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
[mpe: Add fixes tag]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1603349479-26185-1-git-send-email-kernelfans@gmail.com
arch/powerpc/kernel/time.c

index 67feb35..83633a2 100644 (file)
@@ -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>
 
@@ -1030,6 +1031,7 @@ void __init time_init(void)
        tick_setup_hrtimer_broadcast();
 
        of_clk_init(NULL);
+       enable_sched_clock_irqtime();
 }
 
 /*