The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] sched/fair: fix find_idlest_cpu return -1
@ 2014-12-05  5:58 jun.zhang
  2014-12-05  6:38 ` Hillf Danton
  2014-12-15 16:59 ` Peter Zijlstra
  0 siblings, 2 replies; 3+ messages in thread
From: jun.zhang @ 2014-12-05  5:58 UTC (permalink / raw)
  To: mingo, peterz
  Cc: linux-kernel, stable, zhang jun, Chuansheng Liu, Changcheng Liu,
	Hillf Danton, Vincent Guittot

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


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

* Re: [PATCH] sched/fair: fix find_idlest_cpu return -1
  2014-12-05  5:58 [PATCH] sched/fair: fix find_idlest_cpu return -1 jun.zhang
@ 2014-12-05  6:38 ` Hillf Danton
  2014-12-15 16:59 ` Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: Hillf Danton @ 2014-12-05  6:38 UTC (permalink / raw)
  To: jun.zhang, mingo, peterz
  Cc: linux-kernel, stable, 'Chuansheng Liu',
	'Changcheng Liu', 'Vincent Guittot', pang.xunlei

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


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

* Re: [PATCH] sched/fair: fix find_idlest_cpu return -1
  2014-12-05  5:58 [PATCH] sched/fair: fix find_idlest_cpu return -1 jun.zhang
  2014-12-05  6:38 ` Hillf Danton
@ 2014-12-15 16:59 ` Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2014-12-15 16:59 UTC (permalink / raw)
  To: jun.zhang
  Cc: mingo, linux-kernel, stable, Chuansheng Liu, Changcheng Liu,
	Hillf Danton, Vincent Guittot

On Fri, Dec 05, 2014 at 01:58:01PM +0800, jun.zhang@intel.com wrote:
> From: zhang jun <jun.zhang@intel.com>
> 
> find_idlest_cpu return -1 is not reasonable, set default value to this_cpu.

This fails to explain why.

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

This is an invalid SoB chain.

> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: <stable@vger.kernel.org> # 3.14.25

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

end of thread, other threads:[~2014-12-15 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05  5:58 [PATCH] sched/fair: fix find_idlest_cpu return -1 jun.zhang
2014-12-05  6:38 ` Hillf Danton
2014-12-15 16:59 ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox