powerpc/time: enable sched clock for irqtime
PATCH 1/1 powerpc/time: enable sched clock for irqtime
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.
--- arch/powerpc/kernel/time.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kernel/time.c +2 -0
@@ -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 (); }/*
Signature · 1 line
2.7.5
I encounter a irq flood on Power9 machine, and tries a way to work around it by https://www.spinics.net/lists/kernel/msg3705028.html
As irq time accounting is the foundation for the method, it needs to make irq accounting take effect on powerpc platform.
Quoted 41 lines · Pingfan Liu
When
CONFIG_IRQ_TIME_ACCOUNTINGandCONFIG_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 toenable_sched_clock_irqtime()to enable irq time accounting.Signed-off-by Pingfan Liu <[email protected]>Cc Michael Ellerman <[email protected]>Cc Christophe Leroy <[email protected]>Cc Nicholas Piggin <[email protected]>--- arch/powerpc/kernel/time.c | 2 ++ 1 file changed, 2 insertions(+)arch/powerpc/kernel/time.c +2
-1@@ -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
Michael Ellerman
AppliedQuoted 7 lines · Pingfan Liu
When
CONFIG_IRQ_TIME_ACCOUNTINGandCONFIG_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 toenable_sched_clock_irqtime()to enable irq time accounting.
Applied to powerpc/next.
[1/1] powerpc/time: Enable sched clock for irqtime
https://git.kernel.org/powerpc/c/b709e32ef570b8b91dfbcb63cffac4324c87799f
cheers