linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] Print a log when the sched clock is marked unstable
@ 2021-06-27  6:49 Ani Sinha
  2021-07-03 17:29 ` Ani Sinha
  2021-07-07 10:12 ` Thomas Gleixner
  0 siblings, 2 replies; 4+ messages in thread
From: Ani Sinha @ 2021-06-27  6:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: anirban.sinha, tglx, Ani Sinha, Ingo Molnar, Peter Zijlstra,
	Juri Lelli, Vincent Guittot, Dietmar Eggemann, Steven Rostedt,
	Ben Segall, Mel Gorman, Daniel Bristot de Oliveira

In other parts of the kernel when the sched clock transitions from
stable to unstable and vice versa, a kernel info log is printed.
When the sched clock is marked explicitly as unstable, we should
print an information log as well. This patch addresses this. It is
useful in cases where for example, we want to understand why a
certain feature like NOHZ, which depends on a stable sched clock, is
not available.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
---
 kernel/sched/clock.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

See also thread
https://lkml.org/lkml/2021/6/20/32

diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index c2b2859ddd82..5a403b2c9b3f 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -192,8 +192,10 @@ void clear_sched_clock_stable(void)
 
 	smp_mb(); /* matches sched_clock_init_late() */
 
-	if (static_key_count(&sched_clock_running.key) == 2)
+	if (static_key_count(&sched_clock_running.key) == 2) {
+		pr_info("sched_clock: Marking unstable.\n");
 		__clear_sched_clock_stable();
+	}
 }
 
 static void __sched_clock_gtod_offset(void)
-- 
2.25.1

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

* Re: [PATCH v1] Print a log when the sched clock is marked unstable
  2021-06-27  6:49 [PATCH v1] Print a log when the sched clock is marked unstable Ani Sinha
@ 2021-07-03 17:29 ` Ani Sinha
  2021-07-07 10:12 ` Thomas Gleixner
  1 sibling, 0 replies; 4+ messages in thread
From: Ani Sinha @ 2021-07-03 17:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: anirban.sinha, Thomas Gleixner, Ingo Molnar, Peter Zijlstra,
	Juri Lelli, Vincent Guittot, Dietmar Eggemann, Steven Rostedt,
	Ben Segall, Mel Gorman, Daniel Bristot de Oliveira

ping ...

On Sun, Jun 27, 2021 at 12:19 PM Ani Sinha <ani@anisinha.ca> wrote:
>
> In other parts of the kernel when the sched clock transitions from
> stable to unstable and vice versa, a kernel info log is printed.
> When the sched clock is marked explicitly as unstable, we should
> print an information log as well. This patch addresses this. It is
> useful in cases where for example, we want to understand why a
> certain feature like NOHZ, which depends on a stable sched clock, is
> not available.
>
> Signed-off-by: Ani Sinha <ani@anisinha.ca>
> ---
>  kernel/sched/clock.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> See also thread
> https://lkml.org/lkml/2021/6/20/32
>
> diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
> index c2b2859ddd82..5a403b2c9b3f 100644
> --- a/kernel/sched/clock.c
> +++ b/kernel/sched/clock.c
> @@ -192,8 +192,10 @@ void clear_sched_clock_stable(void)
>
>         smp_mb(); /* matches sched_clock_init_late() */
>
> -       if (static_key_count(&sched_clock_running.key) == 2)
> +       if (static_key_count(&sched_clock_running.key) == 2) {
> +               pr_info("sched_clock: Marking unstable.\n");
>                 __clear_sched_clock_stable();
> +       }
>  }
>
>  static void __sched_clock_gtod_offset(void)
> --
> 2.25.1

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

* Re: [PATCH v1] Print a log when the sched clock is marked unstable
  2021-06-27  6:49 [PATCH v1] Print a log when the sched clock is marked unstable Ani Sinha
  2021-07-03 17:29 ` Ani Sinha
@ 2021-07-07 10:12 ` Thomas Gleixner
  2021-07-07 11:05   ` Ani Sinha
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2021-07-07 10:12 UTC (permalink / raw)
  To: Ani Sinha, linux-kernel
  Cc: anirban.sinha, Ani Sinha, Ingo Molnar, Peter Zijlstra,
	Juri Lelli, Vincent Guittot, Dietmar Eggemann, Steven Rostedt,
	Ben Segall, Mel Gorman, Daniel Bristot de Oliveira

Ani,

On Sun, Jun 27 2021 at 12:19, Ani Sinha wrote:

I asked you to read Documentation/process carefully and I told you:

        Also your subject line want's a proper prefix.

Your patch is missing a prefix again. Hint:

  git log kernel/sched/clock.c

> In other parts of the kernel when the sched clock transitions from
> stable to unstable and vice versa, a kernel info log is printed.  When
> the sched clock is marked explicitly as unstable, we should print an
> information log as well. This patch addresses this. It is useful in

git grep 'This patch' Documentation/process/

Also please avoid the 'we' wording. 'We should print' does not make
sense if you really think about it.

> cases where for example, we want to understand why a certain feature
> like NOHZ, which depends on a stable sched clock, is not available.
>
> Signed-off-by: Ani Sinha <ani@anisinha.ca>
> ---
>  kernel/sched/clock.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> See also thread
> https://lkml.org/lkml/2021/6/20/32
>
> diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
> index c2b2859ddd82..5a403b2c9b3f 100644
> --- a/kernel/sched/clock.c
> +++ b/kernel/sched/clock.c
> @@ -192,8 +192,10 @@ void clear_sched_clock_stable(void)
>  
>  	smp_mb(); /* matches sched_clock_init_late() */
>  
> -	if (static_key_count(&sched_clock_running.key) == 2)
> +	if (static_key_count(&sched_clock_running.key) == 2) {
> +		pr_info("sched_clock: Marking unstable.\n");
>  		__clear_sched_clock_stable();

Why isn't that in __clear_sched_clock_stable() ?

Thanks,

        tglx

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

* Re: [PATCH v1] Print a log when the sched clock is marked unstable
  2021-07-07 10:12 ` Thomas Gleixner
@ 2021-07-07 11:05   ` Ani Sinha
  0 siblings, 0 replies; 4+ messages in thread
From: Ani Sinha @ 2021-07-07 11:05 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ani Sinha, linux-kernel, anirban.sinha, Ingo Molnar,
	Peter Zijlstra, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira


Tglx,

On Wed, 7 Jul 2021, Thomas Gleixner wrote:

> Ani,
>
> On Sun, Jun 27 2021 at 12:19, Ani Sinha wrote:
>
> I asked you to read Documentation/process carefully and I told you:
>
>         Also your subject line want's a proper prefix.
>
> Your patch is missing a prefix again. Hint:
>
>   git log kernel/sched/clock.c
>

OK thanks for the pointer. Its my bad that staring at the computer for so
many hours stuck at home makes me read "prefix" as "fix". So I read

Also your subject line want's a proper fix


> > In other parts of the kernel when the sched clock transitions from
> > stable to unstable and vice versa, a kernel info log is printed.  When
> > the sched clock is marked explicitly as unstable, we should print an
> > information log as well. This patch addresses this. It is useful in
>
> git grep 'This patch' Documentation/process/
>
> Also please avoid the 'we' wording. 'We should print' does not make
> sense if you really think about it.

Please understand that Linux kernel is not the only upstream software
where I am contrinuting. Each community has their own rules. Maybe add a
check in checkpatch.pl in the kernel so that these things maybe caught
automatically?

>
> > cases where for example, we want to understand why a certain feature
> > like NOHZ, which depends on a stable sched clock, is not available.
> >
> > Signed-off-by: Ani Sinha <ani@anisinha.ca>
> > ---
> >  kernel/sched/clock.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > See also thread
> > https://lkml.org/lkml/2021/6/20/32
> >
> > diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
> > index c2b2859ddd82..5a403b2c9b3f 100644
> > --- a/kernel/sched/clock.c
> > +++ b/kernel/sched/clock.c
> > @@ -192,8 +192,10 @@ void clear_sched_clock_stable(void)
> >
> >  	smp_mb(); /* matches sched_clock_init_late() */
> >
> > -	if (static_key_count(&sched_clock_running.key) == 2)
> > +	if (static_key_count(&sched_clock_running.key) == 2) {
> > +		pr_info("sched_clock: Marking unstable.\n");
> >  		__clear_sched_clock_stable();
>
> Why isn't that in __clear_sched_clock_stable() ?
>

updated in v2. Makes sense do emit the log at the lowest level of
abstraction so that all code paths are potentially caught.

Ani


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

end of thread, other threads:[~2021-07-07 11:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27  6:49 [PATCH v1] Print a log when the sched clock is marked unstable Ani Sinha
2021-07-03 17:29 ` Ani Sinha
2021-07-07 10:12 ` Thomas Gleixner
2021-07-07 11:05   ` Ani Sinha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).