linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Correct documentation for /proc/schedstat
@ 2019-07-24 18:50 Phil Frost
  2019-07-26 20:41 ` Jonathan Corbet
  2020-05-15 18:08 ` Song Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Phil Frost @ 2019-07-24 18:50 UTC (permalink / raw)
  Cc: Ingo Molnar, trivial, Phil Frost, Jonathan Corbet, linux-doc,
	linux-kernel

Commit 425e0968a25fa3f111f9919964cac079738140b5 ("sched: move code into
kernel/sched_stats.h") appears to have inadvertently changed the unit of
time from jiffies to nanoseconds as part of the implementation of CFS.

Signed-off-by: Phil Frost <indigo@bitglue.com>
---
 Documentation/scheduler/sched-stats.txt | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/scheduler/sched-stats.txt b/Documentation/scheduler/sched-stats.txt
index 8259b34a66ae..b6c1807a01b3 100644
--- a/Documentation/scheduler/sched-stats.txt
+++ b/Documentation/scheduler/sched-stats.txt
@@ -19,6 +19,11 @@ are no architectures which need more than three domain levels. The first
 field in the domain stats is a bit map indicating which cpus are affected
 by that domain.
 
+2.6.23 introduced the CFS scheduler, and also an inadvertent
+backwards-incompatible change to the statistics. Although the schedstat version
+is 14 in either case, in 2.6.23 and later, counters accumulate time in
+nanoseconds. Prior to that, jiffies.
+
 These fields are counters, and only increment.  Programs which make use
 of these will need to start with a baseline observation and then calculate
 the change in the counters at each subsequent observation.  A perl script
@@ -48,9 +53,10 @@ Next two are try_to_wake_up() statistics:
      6) # of times try_to_wake_up() was called to wake up the local cpu
 
 Next three are statistics describing scheduling latency:
-     7) sum of all time spent running by tasks on this processor (in jiffies)
+     7) sum of all time spent running by tasks on this processor (in
+        nanoseconds, or jiffies prior to 2.6.23)
      8) sum of all time spent waiting to run by tasks on this processor (in
-        jiffies)
+        nanoseconds, or jiffies prior to 2.6.23)
      9) # of timeslices run on this cpu
 
 
-- 
2.20.1 (Apple Git-117)


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

* Re: [PATCH] Correct documentation for /proc/schedstat
  2019-07-24 18:50 [PATCH] Correct documentation for /proc/schedstat Phil Frost
@ 2019-07-26 20:41 ` Jonathan Corbet
  2020-05-15 18:08 ` Song Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2019-07-26 20:41 UTC (permalink / raw)
  To: Phil Frost; +Cc: Ingo Molnar, trivial, linux-doc, linux-kernel

On Wed, 24 Jul 2019 11:50:27 -0700
Phil Frost <indigo@bitglue.com> wrote:

> Commit 425e0968a25fa3f111f9919964cac079738140b5 ("sched: move code into
> kernel/sched_stats.h") appears to have inadvertently changed the unit of
> time from jiffies to nanoseconds as part of the implementation of CFS.
> 
> Signed-off-by: Phil Frost <indigo@bitglue.com>
> ---
>  Documentation/scheduler/sched-stats.txt | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/scheduler/sched-stats.txt b/Documentation/scheduler/sched-stats.txt
> index 8259b34a66ae..b6c1807a01b3 100644
> --- a/Documentation/scheduler/sched-stats.txt
> +++ b/Documentation/scheduler/sched-stats.txt
> @@ -19,6 +19,11 @@ are no architectures which need more than three domain levels. The first
>  field in the domain stats is a bit map indicating which cpus are affected
>  by that domain.
>  
> +2.6.23 introduced the CFS scheduler, and also an inadvertent
> +backwards-incompatible change to the statistics. Although the schedstat version
> +is 14 in either case, in 2.6.23 and later, counters accumulate time in
> +nanoseconds. Prior to that, jiffies.

Clearly, making the documentation correct is a good thing to do.  I do
have to wonder if we really have to document how things were 12 years ago
as well, though.  Anybody who is unfortunate enough to be dealing with a
pre-2.6.23 kernel will want to refer to the documentation files shipped
with that kernel rather than what we have now.  So I'd recommend just
making the file reflect the current state of affairs.

Thanks,

jon

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

* Re: [PATCH] Correct documentation for /proc/schedstat
  2019-07-24 18:50 [PATCH] Correct documentation for /proc/schedstat Phil Frost
  2019-07-26 20:41 ` Jonathan Corbet
@ 2020-05-15 18:08 ` Song Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2020-05-15 18:08 UTC (permalink / raw)
  To: Phil Frost, davidca, haowanglud
  Cc: Ingo Molnar, trivial, Jonathan Corbet, Linux Doc Mailing List, open list

Hi Phil,

On Wed, Jul 24, 2019 at 12:26 PM Phil Frost <indigo@bitglue.com> wrote:
>
> Commit 425e0968a25fa3f111f9919964cac079738140b5 ("sched: move code into
> kernel/sched_stats.h") appears to have inadvertently changed the unit of
> time from jiffies to nanoseconds as part of the implementation of CFS.
>
> Signed-off-by: Phil Frost <indigo@bitglue.com>

Do you plan to resend this patch? The file has been updated to sched-stats.rst.

Thanks,
Song

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

end of thread, other threads:[~2020-05-15 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 18:50 [PATCH] Correct documentation for /proc/schedstat Phil Frost
2019-07-26 20:41 ` Jonathan Corbet
2020-05-15 18:08 ` Song Liu

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).