From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx115.postini.com [74.125.245.115]) by kanga.kvack.org (Postfix) with SMTP id 2595D6B0068 for ; Tue, 29 May 2012 10:03:12 -0400 (EDT) Message-ID: <1338300173.26856.83.camel@twins> Subject: Re: [PATCH 20/35] autonuma: avoid CFS select_task_rq_fair to return -1 From: Peter Zijlstra Date: Tue, 29 May 2012 16:02:53 +0200 In-Reply-To: <1337965359-29725-21-git-send-email-aarcange@redhat.com> References: <1337965359-29725-1-git-send-email-aarcange@redhat.com> <1337965359-29725-21-git-send-email-aarcange@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Andrea Arcangeli Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Hillf Danton , Dan Smith , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter On Fri, 2012-05-25 at 19:02 +0200, Andrea Arcangeli wrote: > Fix to avoid -1 retval. >=20 > Includes fixes from Hillf Danton . This changelog is very much insufficient. It fails to mention why your solution is the right one or if there's something else wrong with that code. > Signed-off-by: Andrea Arcangeli > --- > kernel/sched/fair.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) >=20 > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 940e6d1..137119f 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -2789,6 +2789,9 @@ select_task_rq_fair(struct task_struct *p, int sd_f= lag, int wake_flags) > if (new_cpu =3D=3D -1 || new_cpu =3D=3D cpu) { > /* Now try balancing at a lower domain level of cpu */ > sd =3D sd->child; > + if (new_cpu < 0) > + /* Return prev_cpu is find_idlest_cpu failed */ > + new_cpu =3D prev_cpu; > continue; > } > =20 > @@ -2807,6 +2810,7 @@ select_task_rq_fair(struct task_struct *p, int sd_f= lag, int wake_flags) > unlock: > rcu_read_unlock(); > =20 > + BUG_ON(new_cpu < 0); > return new_cpu; > } > #endif /* CONFIG_SMP */ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org