linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re:[PATCH]sched/rt: Do not try to push tasks if pinned task switches to RT
@ 2013-01-29 14:45 Kirill Tkhai
  2014-03-12 10:18 ` [PATCH]sched/rt: " Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Kirill Tkhai @ 2013-01-29 14:45 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra, linux-rt-users

> On Tue, 2013-01-29 at 00:23 +0400, Kirill Tkhai wrote:
> 
>> Just switched pinned task is not able to be pushed. If the rq had had
>> several RT tasks before they have already been considered as candidates
>> to be pushed (or pulled).
> 
> Thanks, but I have one minor nit.
> 
>> 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>
>> CC: linux-rt-users <linux-rt-users@vger.kernel.org>
>> ---
>> kernel/sched/rt.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
>> index 4e8f0f4..5f7d92b 100644
>> --- a/kernel/sched/rt.c
>> +++ b/kernel/sched/rt.c
>> @@ -1925,9 +1925,9 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
>> */
>> if (p->on_rq && rq->curr != p) {
>> #ifdef CONFIG_SMP
>> - if (rq->rt.overloaded && push_rt_task(rq) &&
>> + if (rq->rt.overloaded && p->nr_cpus_allowed > 1 &&
> 
> I would swap the order here. That is, check p->nr_cpus_allowed before
> rq->rt.overloaded. The order doesn't really matter, and even though
> rq->rt.overloaded is probably more likely to be 0, it is used by other
> CPUs. And as a micro-optimization, I rather read something that is used
> by only one CPU than to read something that may be modified by many
> CPUs.
> 
> -- Steve
> 

I corrected. Thanks.

[PATCH]sched/rt: Do not try to push tasks if pinned task switches to RT

Just switched pinned task is not able to be pushed. If the rq had had
several RT tasks before they have already been considered as candidates
to be pushed (or pulled).

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>
CC: linux-rt-users <linux-rt-users@vger.kernel.org>
---
 kernel/sched/rt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 4e8f0f4..5aab032 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1925,9 +1925,9 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
 	 */
 	if (p->on_rq && rq->curr != p) {
 #ifdef CONFIG_SMP
-		if (rq->rt.overloaded && push_rt_task(rq) &&
+		if (p->nr_cpus_allowed > 1 && rq->rt.overloaded &&
 		    /* Don't resched if we changed runqueues */
-		    rq != task_rq(p))
+		    push_rt_task(rq) && rq != task_rq(p))
 			check_resched = 0;
 #endif /* CONFIG_SMP */
 		if (check_resched && p->prio < rq->curr->prio)

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH]sched/rt: Do not try to push tasks if pinned task switches to RT
@ 2013-01-28 20:23 Kirill Tkhai
  2013-01-29  8:42 ` Libo Chen
  2013-01-29 13:26 ` Steven Rostedt
  0 siblings, 2 replies; 9+ messages in thread
From: Kirill Tkhai @ 2013-01-28 20:23 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: Steven Rostedt, Ingo Molnar, Peter Zijlstra, linux-rt-users

Just switched pinned task is not able to be pushed. If the rq had had
several RT tasks before they have already been considered as candidates
to be pushed (or pulled).

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>
CC: linux-rt-users <linux-rt-users@vger.kernel.org>
---
 kernel/sched/rt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 4e8f0f4..5f7d92b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1925,9 +1925,9 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
 	 */
 	if (p->on_rq && rq->curr != p) {
 #ifdef CONFIG_SMP
-		if (rq->rt.overloaded && push_rt_task(rq) &&
+		if (rq->rt.overloaded && p->nr_cpus_allowed > 1 &&
 		    /* Don't resched if we changed runqueues */
-		    rq != task_rq(p))
+		    push_rt_task(rq) && rq != task_rq(p))
 			check_resched = 0;
 #endif /* CONFIG_SMP */
 		if (check_resched && p->prio < rq->curr->prio)

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

end of thread, other threads:[~2014-03-20 18:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 14:45 Re:[PATCH]sched/rt: Do not try to push tasks if pinned task switches to RT Kirill Tkhai
2014-03-12 10:18 ` [PATCH]sched/rt: " Steven Rostedt
2014-03-12 10:39   ` Nicholas Mc Guire
2014-03-12 12:23     ` Kirill Tkhai
2014-03-20 18:21       ` Steven Rostedt
2014-03-12 13:33   ` Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2013-01-28 20:23 Kirill Tkhai
2013-01-29  8:42 ` Libo Chen
2013-01-29 13:26 ` Steven Rostedt

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).