linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]sched/rt.c: Add reschedule to switched_from_rt()
@ 2012-11-22 20:02 Kirill Tkhai
  2012-11-28  3:45 ` Steven Rostedt
  2013-01-24 20:36 ` [tip:sched/core] sched/rt: Add reschedule check " tip-bot for Kirill Tkhai
  0 siblings, 2 replies; 3+ messages in thread
From: Kirill Tkhai @ 2012-11-22 20:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: Steven Rostedt, Ingo Molnar, Peter Zijlstra, Tkhai Kirill

Reschedule rq->curr if the first RT task has just been
pulled to the rq.

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ingo Molnar <mingo@kernel.org>
CC: Peter Zijlstra <peterz@infradead.org>
---
 kernel/sched/rt.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 418feb0..29bda5b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH]sched/rt.c: Add reschedule to switched_from_rt()
  2012-11-22 20:02 [PATCH]sched/rt.c: Add reschedule to switched_from_rt() Kirill Tkhai
@ 2012-11-28  3:45 ` Steven Rostedt
  2013-01-24 20:36 ` [tip:sched/core] sched/rt: Add reschedule check " tip-bot for Kirill Tkhai
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2012-11-28  3:45 UTC (permalink / raw)
  To: Kirill Tkhai; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra

On Fri, 2012-11-23 at 00:02 +0400, Kirill Tkhai wrote:
> Reschedule rq->curr if the first RT task has just been
> pulled to the rq.
> 
> Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
> CC: Steven Rostedt <rostedt@goodmis.org>
> CC: Ingo Molnar <mingo@kernel.org>
> CC: Peter Zijlstra <peterz@infradead.org>
> ---
>  kernel/sched/rt.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 418feb0..29bda5b 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -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.

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

>  }
>  
>  void init_sched_rt_class(void)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:sched/core] sched/rt: Add reschedule check to switched_from_rt()
  2012-11-22 20:02 [PATCH]sched/rt.c: Add reschedule to switched_from_rt() Kirill Tkhai
  2012-11-28  3:45 ` Steven Rostedt
@ 2013-01-24 20:36 ` tip-bot for Kirill Tkhai
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Kirill Tkhai @ 2013-01-24 20:36 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, peterz, tkhai, tglx

Commit-ID:  1158ddb55416855fd17abe3214298f736f00426a
Gitweb:     http://git.kernel.org/tip/1158ddb55416855fd17abe3214298f736f00426a
Author:     Kirill Tkhai <tkhai@yandex.ru>
AuthorDate: Fri, 23 Nov 2012 00:02:15 +0400
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tkhai Kirill <tkhai@yandex.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/118761353614535@web28f.yandex.ru
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/rt.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 418feb0..29bda5b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-24 20:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-22 20:02 [PATCH]sched/rt.c: Add reschedule to switched_from_rt() Kirill Tkhai
2012-11-28  3:45 ` Steven Rostedt
2013-01-24 20:36 ` [tip:sched/core] sched/rt: Add reschedule check " tip-bot for Kirill Tkhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).