2021-09-05 14:39:22

by Yafang Shao

[permalink] [raw]
Subject: [PATCH v4 7/8] sched, dl: support sched_stat_runtime tracepoint for deadline sched class

The runtime of a DL task has already been there, so we only need to
add a tracepoint.

One difference between fair task and DL task is that there is no vruntime
in dl task. To reuse the sched_stat_runtime tracepoint, '0' is passed as
vruntime for DL task.

The output of this tracepoint for DL task as follows,
top-36462 [047] d.h. 6083.452103: sched_stat_runtime: comm=top pid=36462 runtime=409898 [ns] vruntime=0 [ns]

Signed-off-by: Yafang Shao <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Alison Chaiken <[email protected]>
---
kernel/sched/deadline.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 51dd30990042..73fb33e1868f 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1268,6 +1268,8 @@ static void update_curr_dl(struct rq *rq)
schedstat_set(curr->stats.exec_max,
max(curr->stats.exec_max, delta_exec));

+ trace_sched_stat_runtime(curr, delta_exec, 0);
+
curr->se.sum_exec_runtime += delta_exec;
account_group_exec_runtime(curr, delta_exec);

--
2.18.2


Subject: [tip: sched/core] sched/dl: Support sched_stat_runtime tracepoint for deadline sched class

The following commit has been merged into the sched/core branch of tip:

Commit-ID: db4570a26807a7a955a5dc58e0bea3fc2b1d7c23
Gitweb: https://git.kernel.org/tip/db4570a26807a7a955a5dc58e0bea3fc2b1d7c23
Author: Yafang Shao <[email protected]>
AuthorDate: Sun, 05 Sep 2021 14:35:46
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Wed, 15 Sep 2021 17:49:00 +02:00

sched/dl: Support sched_stat_runtime tracepoint for deadline sched class

The runtime of a DL task has already been there, so we only need to
add a tracepoint.

One difference between fair task and DL task is that there is no vruntime
in dl task. To reuse the sched_stat_runtime tracepoint, '0' is passed as
vruntime for DL task.

The output of this tracepoint for DL task as follows,
top-36462 [047] d.h. 6083.452103: sched_stat_runtime: comm=top pid=36462 runtime=409898 [ns] vruntime=0 [ns]

Signed-off-by: Yafang Shao <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
kernel/sched/deadline.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 51dd309..73fb33e 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1268,6 +1268,8 @@ static void update_curr_dl(struct rq *rq)
schedstat_set(curr->stats.exec_max,
max(curr->stats.exec_max, delta_exec));

+ trace_sched_stat_runtime(curr, delta_exec, 0);
+
curr->se.sum_exec_runtime += delta_exec;
account_group_exec_runtime(curr, delta_exec);

Subject: [tip: sched/core] sched/dl: Support sched_stat_runtime tracepoint for deadline sched class

The following commit has been merged into the sched/core branch of tip:

Commit-ID: 95fd58e8dadb7aa707628a2187c626bb897c49ec
Gitweb: https://git.kernel.org/tip/95fd58e8dadb7aa707628a2187c626bb897c49ec
Author: Yafang Shao <[email protected]>
AuthorDate: Sun, 05 Sep 2021 14:35:46
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Tue, 05 Oct 2021 15:51:52 +02:00

sched/dl: Support sched_stat_runtime tracepoint for deadline sched class

The runtime of a DL task has already been there, so we only need to
add a tracepoint.

One difference between fair task and DL task is that there is no vruntime
in dl task. To reuse the sched_stat_runtime tracepoint, '0' is passed as
vruntime for DL task.

The output of this tracepoint for DL task as follows,
top-36462 [047] d.h. 6083.452103: sched_stat_runtime: comm=top pid=36462 runtime=409898 [ns] vruntime=0 [ns]

Signed-off-by: Yafang Shao <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
kernel/sched/deadline.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 51dd309..73fb33e 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1268,6 +1268,8 @@ static void update_curr_dl(struct rq *rq)
schedstat_set(curr->stats.exec_max,
max(curr->stats.exec_max, delta_exec));

+ trace_sched_stat_runtime(curr, delta_exec, 0);
+
curr->se.sum_exec_runtime += delta_exec;
account_group_exec_runtime(curr, delta_exec);