LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/time: enable sched clock for irqtime
@ 2020-10-22  6:51 Pingfan Liu
  2020-10-22  6:58 ` Pingfan Liu
  2021-02-03 11:40 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Pingfan Liu @ 2020-10-22  6:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Christophe Leroy, Nicholas Piggin, Pingfan Liu

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@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/time: enable sched clock for irqtime
  2020-10-22  6:51 [PATCH] powerpc/time: enable sched clock for irqtime Pingfan Liu
@ 2020-10-22  6:58 ` Pingfan Liu
  2021-02-03 11:40 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Pingfan Liu @ 2020-10-22  6:58 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Christophe Leroy, Nicholas Piggin

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.

On Thu, Oct 22, 2020 at 2:51 PM Pingfan Liu <kernelfans@gmail.com> wrote:
>
> 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@gmail.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Christophe Leroy <christophe.leroy@c-s.fr>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> To: linuxppc-dev@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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/time: enable sched clock for irqtime
  2020-10-22  6:51 [PATCH] powerpc/time: enable sched clock for irqtime Pingfan Liu
  2020-10-22  6:58 ` Pingfan Liu
@ 2021-02-03 11:40 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
  To: linuxppc-dev, Pingfan Liu; +Cc: Christophe Leroy, Nicholas Piggin

On Thu, 22 Oct 2020 14:51:19 +0800, Pingfan Liu wrote:
> 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.

Applied to powerpc/next.

[1/1] powerpc/time: Enable sched clock for irqtime
      https://git.kernel.org/powerpc/c/b709e32ef570b8b91dfbcb63cffac4324c87799f

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-03 12:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-22  6:51 [PATCH] powerpc/time: enable sched clock for irqtime Pingfan Liu
2020-10-22  6:58 ` Pingfan Liu
2021-02-03 11:40 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox