mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: pang.xunlei@zte.com.cn
Cc: Juri Lelli <juri.lelli@gmail.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Xunlei Pang <pang.xunlei@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Xunlei Pang <xlpang@126.com>
Subject: Re: [PATCH 2/2] sched/rt: Optimizate task_woken_rt()
Date: Thu, 30 Apr 2015 22:52:04 -0400	[thread overview]
Message-ID: <20150430225204.09dc119f@grimm.local.home> (raw)
In-Reply-To: <OF5CB344CD.C36F5E18-ON48257E38.0009F380-48257E38.000B4644@zte.com.cn>

On Fri, 1 May 2015 10:02:47 +0800
pang.xunlei@zte.com.cn wrote:

> > > 
> > > - Remove "!test_tsk_need_resched(rq->curr)" condition, because
> > > the flag might be set right before the waking up, but we still
> > > need to push equal or lower priority tasks, it should be removed.
> > > Without this condition, we actually get the right logic.
> > 
> > But doesn't that happen when we schedule?
> 
> It does, but will have some latency.

What latency? The need_resched flag is set, that means as soon as this
CPU is in a preemptable situation, it will schedule. The most common
case would be return from interrupt, as interrupts or softirqs are
usually what trigger the wakeups.

But if we do it here, the need resched flag could be set because
another higher priority task is about to preempt the current one that
is higher than what just woke up. So we move it now to another CPU, and
then on return of the interrupt we schedule. Then the current running
task gets preempted by the higher priority task and it too can migrate
to the CPU we just pushed the other one to, and it still doesn't run,
but yet it got moved for no reason at all.

I feel better if the need resched flag is set, we wait till a schedule
happens to see where everything is about to be moved.


> 
> Still "rq->curr->prio <= p->prio" will be enough for us to ensure the 
> proper 
> push_rt_tasks() without this condition.

I have no idea what the above means.

> 
> Beside that, for "rq->curr->nr_cpus_allowed < 2", I noticed it was 
> introduced 
> by commit b3bc211cfe7d5fe94b, but with "!test_tsk_need_resched(rq->curr)",
> it actaully can't be satisfied.

What can't be satisfied?

> 
> So, I think this condition should be removed.

I'm still not convinced.

-- Steve


  parent reply	other threads:[~2015-05-01  2:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 16:33 [PATCH 1/2] sched/rt: Check to push task away when its affinity is changed Xunlei Pang
2015-04-30 16:33 ` [PATCH 2/2] sched/rt: Optimizate task_woken_rt() Xunlei Pang
2015-04-30 17:01   ` Steven Rostedt
     [not found]     ` <OF5CB344CD.C36F5E18-ON48257E38.0009F380-48257E38.000B4644@zte.com.cn>
2015-05-01  2:52       ` Steven Rostedt [this message]
2015-04-30 17:05 ` [PATCH 1/2] sched/rt: Check to push task away when its affinity is changed Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150430225204.09dc119f@grimm.local.home \
    --to=rostedt@goodmis.org \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pang.xunlei@linaro.org \
    --cc=pang.xunlei@zte.com.cn \
    --cc=peterz@infradead.org \
    --cc=xlpang@126.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®