mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hillf Danton" <hillf.zj@alibaba-inc.com>
To: "'pang.xunlei'" <pang.xunlei@linaro.org>
Cc: "linux-kernel" <linux-kernel@vger.kernel.org>,
	"'Ingo Molnar'" <mingo@redhat.com>,
	"'Peter Zijlstra'" <peterz@infradead.org>,
	"'Steven Rostedt'" <rostedt@goodmis.org>,
	"'Juri Lelli'" <juri.lelli@gmail.com>
Subject: Re: [PATCH v2 2/6] sched/rt: Optimize select_task_rq_rt() for non-RT curr task
Date: Tue, 04 Nov 2014 20:21:37 +0800	[thread overview]
Message-ID: <011501cff829$e1a26e60$a4e74b20$@alibaba-inc.com> (raw)

> 
> When selecting the cpu for a waking RT task, if curr is a non-RT
> task which is bound only on this cpu, then we can give it a chance
> to select a different cpu(definitely an idle cpu if existing) for
> the RT task to avoid curr starving.
> 
> Signed-off-by: pang.xunlei <pang.xunlei@linaro.org>
> ---
>  kernel/sched/rt.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index da6922e..dc1f7f0 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -1340,6 +1340,11 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags)
>  	 * runqueue. Otherwise simply start this RT task
>  	 * on its current runqueue.
>  	 *
> +	 * If the current task on @p's runqueue is a non-RT task,
> +	 * and this task is bound on current runqueue, then try to
> +	 * see if we can wake this RT task up on a different runqueue,
> +	 * we will definitely find an idle cpu if there is any.
> +	 *
>  	 * We want to avoid overloading runqueues. If the woken
>  	 * task is a higher priority, then it will stay on this CPU
>  	 * and the lower prio task should be moved to another CPU.
> @@ -1356,9 +1361,8 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags)
>  	 * This test is optimistic, if we get it wrong the load-balancer
>  	 * will have to sort it out.
>  	 */
> -	if (curr && unlikely(rt_task(curr)) &&
> -	    (curr->nr_cpus_allowed < 2 ||
> -	     curr->prio <= p->prio)) {
> +	if (curr && unlikely(curr->nr_cpus_allowed < 2 ||
> +				curr->prio <= p->prio)) {

Nack, it is no meaning to compare apple against orange.

Hillf
>  		int target = find_lowest_rq(p);
> 
>  		if (target != -1)
> --
> 1.7.9.5


             reply	other threads:[~2014-11-04 12:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 12:21 Hillf Danton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-04 11:13 [PATCH v2 1/6] sched/cpupri: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases pang.xunlei
2014-11-04 11:13 ` [PATCH v2 2/6] sched/rt: Optimize select_task_rq_rt() for non-RT curr task pang.xunlei
2014-11-04 12:52   ` Steven Rostedt
2014-11-04 14:29     ` pang.xunlei
2014-11-04 14:47       ` Steven Rostedt
2014-11-04 15:09         ` pang.xunlei

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='011501cff829$e1a26e60$a4e74b20$@alibaba-inc.com' \
    --to=hillf.zj@alibaba-inc.com \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pang.xunlei@linaro.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /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®