Skip to content

Commit 59f8c29

Browse files
tomcucinottaIngo Molnar
authored andcommitted
sched/deadline: Show leftover runtime and abs deadline in /proc/*/sched
This patch allows for reading the current (leftover) runtime and absolute deadline of a SCHED_DEADLINE task through /proc/*/sched (entries dl.runtime and dl.deadline), while debugging/testing. Signed-off-by: Tommaso Cucinotta <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Juri Lelli <[email protected]> Reviewed-by: Luca Abeni <[email protected]> Acked-by: Daniel Bistrot de Oliveira <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5680d80 commit 59f8c29

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Documentation/scheduler/sched-deadline.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ CONTENTS
408408
* the new scheduling related syscalls that manipulate it, i.e.,
409409
sched_setattr() and sched_getattr() are implemented.
410410

411+
For debugging purposes, the leftover runtime and absolute deadline of a
412+
SCHED_DEADLINE task can be retrieved through /proc/<pid>/sched (entries
413+
dl.runtime and dl.deadline, both values in ns). A programmatic way to
414+
retrieve these values from production code is under discussion.
415+
411416

412417
4.3 Default behavior
413418
---------------------
@@ -476,6 +481,7 @@ CONTENTS
476481

477482
Still missing:
478483

484+
- programmatic way to retrieve current runtime and absolute deadline
479485
- refinements to deadline inheritance, especially regarding the possibility
480486
of retaining bandwidth isolation among non-interacting tasks. This is
481487
being studied from both theoretical and practical points of view, and

kernel/sched/debug.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,10 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
953953
#endif
954954
P(policy);
955955
P(prio);
956+
if (p->policy == SCHED_DEADLINE) {
957+
P(dl.runtime);
958+
P(dl.deadline);
959+
}
956960
#undef PN_SCHEDSTAT
957961
#undef PN
958962
#undef __PN

0 commit comments

Comments
 (0)