sched/deadline: Kill task_struct->pi_top_task
Subsystems (3)
cover sched/deadline: Kill task_struct->pi_top_task
Hi,
The patch looks "trivial and obviously correct" but I don't understand this code, and perhaps ->pi_top_task will have more users... Please review.
Oleg.
PATCH 1/1 sched/deadline: Kill task_struct->pi_top_task
Remove task_struct->pi_top_task. The only user, rt_mutex_setprio(), can use a local.
Signed-off-by Oleg Nesterov <[email protected]>
--- include/linux/sched.h | 2 -- kernel/fork.c | 1 - kernel/sched/core.c | 6 +++--- 3 files changed, 3 insertions(+), 6 deletions(-)
include/linux/sched.h +0 -2
@@ -1386,8 +1386,6 @@ struct task_struct {struct rb_node *pi_waiters_leftmost;/* Deadlock detection and priority inheritance handling */ struct rt_mutex_waiter *pi_blocked_on; -/* Top pi_waiters task */ -struct task_struct *pi_top_task;#endif #ifdef CONFIG_DEBUG_MUTEXES
kernel/fork.c +0 -1
@@ -1094,7 +1094,6 @@ static void rt_mutex_init_task(struct task_struct *p) p->pi_waiters =RB_ROOT ; p->pi_waiters_leftmost =NULL ; p->pi_blocked_on =NULL ; - p->pi_top_task =NULL ;#endif }
kernel/sched/core.c +3 -3
@@ -2888,7 +2888,6 @@ void rt_mutex_setprio(struct task_struct *p, int prio) }trace_sched_pi_setprio (p, prio); - p->pi_top_task =rt_mutex_get_top_task (p); oldprio = p->prio; prev_class = p->sched_class; on_rq = p->on_rq;
@@ -2908,8 +2907,9 @@ void rt_mutex_setprio(struct task_struct *p, int prio)* running task */ if (dl_prio (prio)) { -if (!dl_prio (p->normal_prio) || (p->pi_top_task && -dl_entity_preempt (&p->pi_top_task->dl, &p->dl))) { +struct task_struct *pi_task =rt_mutex_get_top_task (p); +if (!dl_prio (p->normal_prio) || + (pi_task &&dl_entity_preempt (&pi_task->dl, &p->dl))) { p->dl.dl_boosted =1 ; p->dl.dl_throttled =0 ; enqueue_flag =ENQUEUE_REPLENISH ;
Signature · 1 line
1.5.5.1
tip-bot for Oleg Nesterov
merge botsched/deadline: Kill task_struct->pi_top_task
Commit-ID: 466af29bf4270e84261712428a1304c28e3743fa Gitweb: http://git.kernel.org/tip/466af29bf4270e84261712428a1304c28e3743fa Author: Oleg Nesterov <[email protected]> AuthorDate: Fri, 6 Jun 2014 18:52:06 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 16 Jul 2014 13:38:18 +0200
sched/deadline: Kill task_struct->pi_top_task
Remove task_struct->pi_top_task. The only user, rt_mutex_setprio(), can use a local.
Signed-off-by Oleg Nesterov <[email protected]>
Signed-off-by Peter Zijlstra <[email protected]>
Cc Juri Lelli <[email protected]>
Cc Alex Thorlton <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Daeseok Youn <[email protected]>
Cc Dario Faggioli <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc David Rientjes <[email protected]>
Cc Eric W. Biederman <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Matthew Dempsky <[email protected]>
Cc Michal Simek <[email protected]>
Cc Oleg Nesterov <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- include/linux/sched.h | 2 -- kernel/fork.c | 1 - kernel/sched/core.c | 6 +++--- 3 files changed, 3 insertions(+), 6 deletions(-)
include/linux/sched.h +0 -2
@@ -1440,8 +1440,6 @@ struct task_struct {struct rb_node *pi_waiters_leftmost;/* Deadlock detection and priority inheritance handling */ struct rt_mutex_waiter *pi_blocked_on; -/* Top pi_waiters task */ -struct task_struct *pi_top_task;#endif #ifdef CONFIG_DEBUG_MUTEXES
kernel/fork.c +0 -1
@@ -1095,7 +1095,6 @@ static void rt_mutex_init_task(struct task_struct *p) p->pi_waiters =RB_ROOT ; p->pi_waiters_leftmost =NULL ; p->pi_blocked_on =NULL ; - p->pi_top_task =NULL ;#endif }
kernel/sched/core.c +3 -3
@@ -2980,7 +2980,6 @@ void rt_mutex_setprio(struct task_struct *p, int prio) }trace_sched_pi_setprio (p, prio); - p->pi_top_task =rt_mutex_get_top_task (p); oldprio = p->prio; prev_class = p->sched_class; on_rq = p->on_rq;
@@ -3000,8 +2999,9 @@ void rt_mutex_setprio(struct task_struct *p, int prio)* running task */ if (dl_prio (prio)) { -if (!dl_prio (p->normal_prio) || (p->pi_top_task && -dl_entity_preempt (&p->pi_top_task->dl, &p->dl))) { +struct task_struct *pi_task =rt_mutex_get_top_task (p); +if (!dl_prio (p->normal_prio) || + (pi_task &&dl_entity_preempt (&pi_task->dl, &p->dl))) { p->dl.dl_boosted =1 ; p->dl.dl_throttled =0 ; enqueue_flag =ENQUEUE_REPLENISH ;