linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs/scheduler: fix unit error
@ 2022-04-15  3:36 Jui-Tse Huang
  2022-04-16  8:55 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Jui-Tse Huang @ 2022-04-15  3:36 UTC (permalink / raw)
  To: Jonathan Corbet, Peter Zijlstra, Valentin Schneider,
	Mauro Carvalho Chehab, Huaixin Chang, Beata Michalska,
	Chun-Hung Tseng, linux-doc, linux-kernel
  Cc: Jui-Tse Huang, Ching-Chun Huang

The unit mentioned in the documentation of scheduler statistics is
outdated which may mislead the readers.

The unit of statistics that is reported by /proc/schedstat is modified
to nanosecond, and the unit of statistics that is reported by
/proc/PID/schedstat is provided as well to make the context consistent.

The rq_cpu_time and the rq_sched_info.run_delay of a run queue, and the
sched_info.run_delay of a task are all updated based on the clock of the
run queue, while the se.sum_exec_runtime of a task is updated based on
the clock_task of the run queue of the task. Both the clock and
clock_task are relied on the return value of the function sched_clock()
which is in the unit of nanosecond.

Signed-off-by: Jui-Tse Huang <juitse.huang@gmail.com>
---
 Documentation/scheduler/sched-stats.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/scheduler/sched-stats.rst b/Documentation/scheduler/sched-stats.rst
index dd9b99a025f7..03c062915998 100644
--- a/Documentation/scheduler/sched-stats.rst
+++ b/Documentation/scheduler/sched-stats.rst
@@ -56,9 +56,9 @@ Next two are try_to_wake_up() statistics:
 
 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)
      8) sum of all time spent waiting to run by tasks on this processor (in
-        jiffies)
+        nanoseconds)
      9) # of timeslices run on this cpu
 
 
@@ -155,8 +155,8 @@ schedstats also adds a new /proc/<pid>/schedstat file to include some of
 the same information on a per-process level.  There are three fields in
 this file correlating for that process to:
 
-     1) time spent on the cpu
-     2) time spent waiting on a runqueue
+     1) time spent on the cpu (in nanoseconds)
+     2) time spent waiting on a runqueue (in nanoseconds)
      3) # of timeslices run on this cpu
 
 A program could be easily written to make use of these extra fields to
-- 
2.25.1


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

* Re: [PATCH] docs/scheduler: fix unit error
  2022-04-15  3:36 [PATCH] docs/scheduler: fix unit error Jui-Tse Huang
@ 2022-04-16  8:55 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2022-04-16  8:55 UTC (permalink / raw)
  To: Jui-Tse Huang, Peter Zijlstra, Valentin Schneider,
	Mauro Carvalho Chehab, Huaixin Chang, Beata Michalska,
	Chun-Hung Tseng, linux-doc, linux-kernel
  Cc: Jui-Tse Huang, Ching-Chun Huang

Jui-Tse Huang <juitse.huang@gmail.com> writes:

> The unit mentioned in the documentation of scheduler statistics is
> outdated which may mislead the readers.
>
> The unit of statistics that is reported by /proc/schedstat is modified
> to nanosecond, and the unit of statistics that is reported by
> /proc/PID/schedstat is provided as well to make the context consistent.
>
> The rq_cpu_time and the rq_sched_info.run_delay of a run queue, and the
> sched_info.run_delay of a task are all updated based on the clock of the
> run queue, while the se.sum_exec_runtime of a task is updated based on
> the clock_task of the run queue of the task. Both the clock and
> clock_task are relied on the return value of the function sched_clock()
> which is in the unit of nanosecond.
>
> Signed-off-by: Jui-Tse Huang <juitse.huang@gmail.com>
> ---
>  Documentation/scheduler/sched-stats.rst | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Part of this had already been fixed by a previous patch, but git was
able to figure it out...this one's applied as well, thanks.

jon

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

end of thread, other threads:[~2022-04-16  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15  3:36 [PATCH] docs/scheduler: fix unit error Jui-Tse Huang
2022-04-16  8:55 ` Jonathan Corbet

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