mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hillf Danton" <hillf.zj@alibaba-inc.com>
To: <jun.zhang@intel.com>, <mingo@redhat.com>, <peterz@infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>,
	"'Chuansheng Liu'" <chuansheng.liu@intel.com>,
	"'Changcheng Liu'" <changcheng.liu@intel.com>,
	"'Vincent Guittot'" <vincent.guittot@linaro.org>,
	<pang.xunlei@zte.com.cn>
Subject: Re: [PATCH] sched/fair: fix find_idlest_cpu return -1
Date: Fri, 05 Dec 2014 14:38:36 +0800	[thread overview]
Message-ID: <012601d01056$1965d3c0$4c317b40$@alibaba-inc.com> (raw)
In-Reply-To: <1417759082-28385-1-git-send-email-jun.zhang@intel.com>

Cc: pang.xunlei@zte.com.cn
> 
> From: zhang jun <jun.zhang@intel.com>
> 
> find_idlest_cpu return -1 is not reasonable, set default value to this_cpu.
> 
> Signed-off-by: zhang jun <jun.zhang@intel.com>
> Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
> Signed-off-by: Changcheng Liu <changcheng.liu@intel.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: <stable@vger.kernel.org> # 3.14.25
> ---
>  kernel/sched/fair.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 9b4c4f3..9d18887 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4151,7 +4151,7 @@ static int
>  find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
>  {
>  	unsigned long load, min_load = ULONG_MAX;
> -	int idlest = -1;
> +	int idlest = this_cpu;
>  	int i;
> 
>  	/* Traverse only the allowed CPUs */
> @@ -4284,7 +4284,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
>  		}
> 
>  		new_cpu = find_idlest_cpu(group, p, cpu);
> -		if (new_cpu == -1 || new_cpu == cpu) {
> +		if (new_cpu == cpu) {
>  			/* Now try balancing at a lower domain level of cpu */
>  			sd = sd->child;
>  			continue;
> --
> 1.7.9.5


  reply	other threads:[~2014-12-05  6:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  5:58 jun.zhang
2014-12-05  6:38 ` Hillf Danton [this message]
2014-12-15 16:59 ` Peter Zijlstra

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='012601d01056$1965d3c0$4c317b40$@alibaba-inc.com' \
    --to=hillf.zj@alibaba-inc.com \
    --cc=changcheng.liu@intel.com \
    --cc=chuansheng.liu@intel.com \
    --cc=jun.zhang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pang.xunlei@zte.com.cn \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=vincent.guittot@linaro.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®