Skip to content

Commit

Permalink
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
 "Misc fixes: a documentation fix, a Sparse warning fix and a debugging
  fix"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/debug: Fix task state recording/printout
  sched/deadline: Don't use dubious signed bitfields
  sched/deadline: Fix the description of runtime accounting in the documentation
  • Loading branch information
torvalds committed Nov 26, 2017
2 parents 580e3d5 + 3f5fe9f commit 6830c8d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
13 changes: 10 additions & 3 deletions Documentation/scheduler/sched-deadline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,17 @@ CONTENTS
It does so by decrementing the runtime of the executing task Ti at a pace equal
to

dq = -max{ Ui, (1 - Uinact) } dt
dq = -max{ Ui / Umax, (1 - Uinact - Uextra) } dt

where Uinact is the inactive utilization, computed as (this_bq - running_bw),
and Ui is the bandwidth of task Ti.
where:

- Ui is the bandwidth of task Ti;
- Umax is the maximum reclaimable utilization (subjected to RT throttling
limits);
- Uinact is the (per runqueue) inactive utilization, computed as
(this_bq - running_bw);
- Uextra is the (per runqueue) extra reclaimable utilization
(subjected to RT throttling limits).


Let's now see a trivial example of two deadline tasks with runtime equal
Expand Down
8 changes: 4 additions & 4 deletions include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ struct sched_dl_entity {
* conditions between the inactive timer handler and the wakeup
* code.
*/
int dl_throttled : 1;
int dl_boosted : 1;
int dl_yielded : 1;
int dl_non_contending : 1;
unsigned int dl_throttled : 1;
unsigned int dl_boosted : 1;
unsigned int dl_yielded : 1;
unsigned int dl_non_contending : 1;

/*
* Bandwidth enforcement timer. Each -deadline task has its
Expand Down
6 changes: 3 additions & 3 deletions include/trace/events/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
* RUNNING (we will not have dequeued if state != RUNNING).
*/
if (preempt)
return TASK_STATE_MAX;
return TASK_REPORT_MAX;

return task_state_index(p);
return 1 << task_state_index(p);
}
#endif /* CREATE_TRACE_POINTS */

Expand Down Expand Up @@ -164,7 +164,7 @@ TRACE_EVENT(sched_switch,
{ 0x40, "P" }, { 0x80, "I" }) :
"R",

__entry->prev_state & TASK_STATE_MAX ? "+" : "",
__entry->prev_state & TASK_REPORT_MAX ? "+" : "",
__entry->next_comm, __entry->next_pid, __entry->next_prio)
);

Expand Down

0 comments on commit 6830c8d

Please sign in to comment.