sched/rt.c: Add reschedule to switched_from_rt()
PATCH 1/1 sched/rt.c: Add reschedule to switched_from_rt()
Reschedule rq->curr if the first RT task has just been pulled to the rq.
--- kernel/sched/rt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/sched/rt.c +5 -2
@@ -1889,8 +1889,11 @@ static void switched_from_rt(struct rq *rq, struct task_struct *p)* we may need to handle the pulling of RT tasks * now. */ -if (p->on_rq && !rq->rt.rt_nr_running) -pull_rt_task (rq); +if (!p->on_rq || rq->rt.rt_nr_running) +return ; + +if (pull_rt_task (rq)) +resched_task (rq->curr); }void init_sched_rt_class (void )
Quoted 15 lines · Kirill Tkhai
Reschedule
rq->currif the first RT task has just been pulled to the rq.Signed-off-by Kirill V Tkhai <[email protected]>CC Steven Rostedt <[email protected]>CC Ingo Molnar <[email protected]>CC Peter Zijlstra <[email protected]>--- kernel/sched/rt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)kernel/sched/rt.c +0
-0
kernel/sched/rt.c static void switched_from_rt(struct rq *rq, struct task_struct *p) · line 1896
Quoted 10 lines
kernel/sched/rt.c +5
-2@@ -1889,8 +1889,11 @@ static void switched_from_rt(struct rq *rq, struct task_struct *p)* we may need to handle the pulling of RT tasks * now. */ -if (p->on_rq && !rq->rt.rt_nr_running) -pull_rt_task (rq); +if (!p->on_rq || rq->rt.rt_nr_running) +return ; + +if (pull_rt_task (rq)) +resched_task (rq->curr);
Wow really? We never set NEED_RESCHED after pulling an RT task to a queue that is about to run SCHED_OTHER?
Hmm, this is usually called before switched_to(), and looking at switched_to_fair() there's a good chance that it does it.
But anyway, might as well add it here, I don't think it will hurt. The prio_changed_rt() does it.
-- Steve
Quoted 3 lines
kernel/sched/rt.c +0
-0}void init_sched_rt_class (void )
[tip:sched/core] sched/rt: Add reschedule check to switched_from_rt()
In reply to Kirill TkhaiCommit-ID: 1158ddb55416855fd17abe3214298f736f00426a Gitweb: http://git.kernel.org/tip/1158ddb55416855fd17abe3214298f736f00426a Author: Kirill Tkhai <[email protected]> AuthorDate: Fri, 23 Nov 2012 00:02:15 +0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 24 Jan 2013 17:14:30 +0100
sched/rt: Add reschedule check to switched_from_rt()
Reschedule rq->curr if the first RT task has just been pulled to the rq.
--- kernel/sched/rt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/sched/rt.c +5 -2
@@ -1889,8 +1889,11 @@ static void switched_from_rt(struct rq *rq, struct task_struct *p)* we may need to handle the pulling of RT tasks * now. */ -if (p->on_rq && !rq->rt.rt_nr_running) -pull_rt_task (rq); +if (!p->on_rq || rq->rt.rt_nr_running) +return ; + +if (pull_rt_task (rq)) +resched_task (rq->curr); }void init_sched_rt_class (void )