diff options
author | Dario Faggioli <raistlin@linux.it> | 2013-11-07 08:43:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-01-13 07:42:56 -0500 |
commit | 2d3d891d3344159d5b452a645e355bbe29591e8b (patch) | |
tree | ab7c4ef00b48d68efa2d57cabf8c3c86160f2406 /include/linux | |
parent | fb00aca474405f4fa8a8519c3179fed722eabd83 (diff) |
sched/deadline: Add SCHED_DEADLINE inheritance logic
Some method to deal with rt-mutexes and make sched_dl interact with
the current PI-coded is needed, raising all but trivial issues, that
needs (according to us) to be solved with some restructuring of
the pi-code (i.e., going toward a proxy execution-ish implementation).
This is under development, in the meanwhile, as a temporary solution,
what this commits does is:
- ensure a pi-lock owner with waiters is never throttled down. Instead,
when it runs out of runtime, it immediately gets replenished and it's
deadline is postponed;
- the scheduling parameters (relative deadline and default runtime)
used for that replenishments --during the whole period it holds the
pi-lock-- are the ones of the waiting task with earliest deadline.
Acting this way, we provide some kind of boosting to the lock-owner,
still by using the existing (actually, slightly modified by the previous
commit) pi-architecture.
We would stress the fact that this is only a surely needed, all but
clean solution to the problem. In the end it's only a way to re-start
discussion within the community. So, as always, comments, ideas, rants,
etc.. are welcome! :-)
Signed-off-by: Dario Faggioli <raistlin@linux.it>
Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
[ Added !RT_MUTEXES build fix. ]
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1383831828-15501-11-git-send-email-juri.lelli@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 8 | ||||
-rw-r--r-- | include/linux/sched/rt.h | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 9ea15019a5b6..13c53a99920f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1124,8 +1124,12 @@ struct sched_dl_entity { | |||
1124 | * @dl_new tells if a new instance arrived. If so we must | 1124 | * @dl_new tells if a new instance arrived. If so we must |
1125 | * start executing it with full runtime and reset its absolute | 1125 | * start executing it with full runtime and reset its absolute |
1126 | * deadline; | 1126 | * deadline; |
1127 | * | ||
1128 | * @dl_boosted tells if we are boosted due to DI. If so we are | ||
1129 | * outside bandwidth enforcement mechanism (but only until we | ||
1130 | * exit the critical section). | ||
1127 | */ | 1131 | */ |
1128 | int dl_throttled, dl_new; | 1132 | int dl_throttled, dl_new, dl_boosted; |
1129 | 1133 | ||
1130 | /* | 1134 | /* |
1131 | * Bandwidth enforcement timer. Each -deadline task has its | 1135 | * Bandwidth enforcement timer. Each -deadline task has its |
@@ -1359,6 +1363,8 @@ struct task_struct { | |||
1359 | struct rb_node *pi_waiters_leftmost; | 1363 | struct rb_node *pi_waiters_leftmost; |
1360 | /* Deadlock detection and priority inheritance handling */ | 1364 | /* Deadlock detection and priority inheritance handling */ |
1361 | struct rt_mutex_waiter *pi_blocked_on; | 1365 | struct rt_mutex_waiter *pi_blocked_on; |
1366 | /* Top pi_waiters task */ | ||
1367 | struct task_struct *pi_top_task; | ||
1362 | #endif | 1368 | #endif |
1363 | 1369 | ||
1364 | #ifdef CONFIG_DEBUG_MUTEXES | 1370 | #ifdef CONFIG_DEBUG_MUTEXES |
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index 440434df3627..34e4ebea8fce 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
@@ -35,6 +35,7 @@ static inline int rt_task(struct task_struct *p) | |||
35 | #ifdef CONFIG_RT_MUTEXES | 35 | #ifdef CONFIG_RT_MUTEXES |
36 | extern int rt_mutex_getprio(struct task_struct *p); | 36 | extern int rt_mutex_getprio(struct task_struct *p); |
37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
38 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); | ||
38 | extern void rt_mutex_adjust_pi(struct task_struct *p); | 39 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
39 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 40 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
40 | { | 41 | { |
@@ -45,6 +46,10 @@ static inline int rt_mutex_getprio(struct task_struct *p) | |||
45 | { | 46 | { |
46 | return p->normal_prio; | 47 | return p->normal_prio; |
47 | } | 48 | } |
49 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) | ||
50 | { | ||
51 | return NULL; | ||
52 | } | ||
48 | # define rt_mutex_adjust_pi(p) do { } while (0) | 53 | # define rt_mutex_adjust_pi(p) do { } while (0) |
49 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 54 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
50 | { | 55 | { |