Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933788Ab2EYRMX (ORCPT ); Fri, 25 May 2012 13:12:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62567 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756989Ab2EYRD0 (ORCPT ); Fri, 25 May 2012 13:03:26 -0400 From: Andrea Arcangeli To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Hillf Danton , Dan Smith , Peter Zijlstra , 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 Subject: [PATCH 20/35] autonuma: avoid CFS select_task_rq_fair to return -1 Date: Fri, 25 May 2012 19:02:24 +0200 Message-Id: <1337965359-29725-21-git-send-email-aarcange@redhat.com> In-Reply-To: <1337965359-29725-1-git-send-email-aarcange@redhat.com> References: <1337965359-29725-1-git-send-email-aarcange@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1133 Lines: 36 Fix to avoid -1 retval. Includes fixes from Hillf Danton . Signed-off-by: Andrea Arcangeli --- kernel/sched/fair.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) 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_flag, int wake_flags) if (new_cpu == -1 || new_cpu == cpu) { /* Now try balancing at a lower domain level of cpu */ sd = sd->child; + if (new_cpu < 0) + /* Return prev_cpu is find_idlest_cpu failed */ + new_cpu = prev_cpu; continue; } @@ -2807,6 +2810,7 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags) unlock: rcu_read_unlock(); + BUG_ON(new_cpu < 0); return new_cpu; } #endif /* CONFIG_SMP */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/