Skip to content

Commit b95202a

Browse files
tomcucinottaingomolnar
authored andcommitted
sched/deadline: Document behavior of sched_yield()
This is a documentation only patch, explaining the behavior of sched_yield() when a SCHED_DEADLINE task calls it (give up remaining runtime and be throttled until next period begins). Signed-off-by: Tommaso Cucinotta <tommaso.cucinotta@sssup.it> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Juri Lelli <juri.lelli@arm.com> Reviewed-by: Luca Abeni <luca.abeni@unitn.it> Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com> Cc: Juri Lelli <juri.lelli@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-dl@retis.sssup.it Link: http://lkml.kernel.org/r/1473443117-11794-2-git-send-email-tommaso.cucinotta@sssup.it Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent de58af8 commit b95202a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎Documentation/scheduler/sched-deadline.txt‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CONTENTS
1616
4.1 System-wide settings
1717
4.2 Task interface
1818
4.3 Default behavior
19+
4.4 Behavior of sched_yield()
1920
5. Tasks CPU affinity
2021
5.1 SCHED_DEADLINE and cpusets HOWTO
2122
6. Future plans
@@ -426,6 +427,23 @@ CONTENTS
426427
Finally, notice that in order not to jeopardize the admission control a
427428
-deadline task cannot fork.
428429

430+
431+
4.4 Behavior of sched_yield()
432+
-----------------------------
433+
434+
When a SCHED_DEADLINE task calls sched_yield(), it gives up its
435+
remaining runtime and is immediately throttled, until the next
436+
period, when its runtime will be replenished (a special flag
437+
dl_yielded is set and used to handle correctly throttling and runtime
438+
replenishment after a call to sched_yield()).
439+
440+
This behavior of sched_yield() allows the task to wake-up exactly at
441+
the beginning of the next period. Also, this may be useful in the
442+
future with bandwidth reclaiming mechanisms, where sched_yield() will
443+
make the leftoever runtime available for reclamation by other
444+
SCHED_DEADLINE tasks.
445+
446+
429447
5. Tasks CPU affinity
430448
=====================
431449

0 commit comments

Comments
 (0)