From patchwork Fri Oct 18 11:52:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 21123 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3D3525E7E for ; Fri, 18 Oct 2013 11:53:58 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id k18sf5616857qcv.9 for ; Fri, 18 Oct 2013 04:53:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=wIU+hHiuiFcBatMHSDYNxa3RnwcDlQsLiYx4GC6IuI4=; b=PBSQffRmNXP9gAoXeWv6VKd7u1lpFXcn9PUwbQB8YND+6NB1PTZtGZK9ZTJFQGFISq mZjOI/IdiPU1xh1lQPvcSrUx0W/0WlQ5zbJgW3YR5FrzjnGeOWgEOqumn0Mq1fiMzzJR 9NTpEgz6fizyAt4+HxEuFXSCQwwPhIj0EIEGck0/D3vu3cPheNn341Y89m7JxUJKeXHP Z6MayEUCyBUuy1GlKFQfn6dTi94kw3rrNISW2akHtcPmkgeBS75BAxRnglBohM+eet+d Tv7ooLALW1V7ZePWBiO/u6GH8r5vorHI+uOJCA/qWNaFhS6V4UY6dqZYR1doSAKMOeyd jIdQ== X-Received: by 10.236.32.74 with SMTP id n50mr2450574yha.13.1382097238629; Fri, 18 Oct 2013 04:53:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.133 with SMTP id h5ls1387224qej.54.gmail; Fri, 18 Oct 2013 04:53:58 -0700 (PDT) X-Received: by 10.52.118.73 with SMTP id kk9mr1444078vdb.13.1382097238507; Fri, 18 Oct 2013 04:53:58 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id dt10si238276vdb.8.2013.10.18.04.53.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:53:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id c14so2039868vea.30 for ; Fri, 18 Oct 2013 04:53:58 -0700 (PDT) X-Gm-Message-State: ALoCoQkCC8wLgkmD2kT3WPBZJuJGKFZ3buaQ2YtU+GQZU0KPUuul6jgTYdnO/XLbspA4oZ4SDj6z X-Received: by 10.220.58.1 with SMTP id e1mr1765490vch.0.1382097238371; Fri, 18 Oct 2013 04:53:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp29491vcz; Fri, 18 Oct 2013 04:53:57 -0700 (PDT) X-Received: by 10.180.79.227 with SMTP id m3mr2705565wix.2.1382097237504; Fri, 18 Oct 2013 04:53:57 -0700 (PDT) Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179]) by mx.google.com with ESMTPS id df5si4153667wib.68.2013.10.18.04.53.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:53:57 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.179 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.179; Received: by mail-we0-f179.google.com with SMTP id w61so3531310wes.24 for ; Fri, 18 Oct 2013 04:53:57 -0700 (PDT) X-Received: by 10.180.126.101 with SMTP id mx5mr2509103wib.63.1382097237036; Fri, 18 Oct 2013 04:53:57 -0700 (PDT) Received: from localhost.localdomain (LPuteaux-156-14-44-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id lr3sm25000673wic.5.2013.10.18.04.53.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:53:56 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, pjt@google.com, Morten.Rasmussen@arm.com, cmetcalf@tilera.com, tony.luck@intel.com, alex.shi@intel.com, preeti@linux.vnet.ibm.com, linaro-kernel@lists.linaro.org Cc: rjw@sisk.pl, paulmck@linux.vnet.ibm.com, corbet@lwn.net, tglx@linutronix.de, len.brown@intel.com, arjan@linux.intel.com, amit.kucheria@linaro.org, l.majewski@samsung.com, Vincent Guittot Subject: [RFC][PATCH v5 10/14] sched: init this_load to max in find_idlest_group Date: Fri, 18 Oct 2013 13:52:23 +0200 Message-Id: <1382097147-30088-10-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1382097147-30088-1-git-send-email-vincent.guittot@linaro.org> References: <1382097147-30088-1-git-send-email-vincent.guittot@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vincent.guittot@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Init this_load to max value instead of 0 in find_idlest_group. If the local group is skipped because it doesn't have allowed CPUs, this_load stays to 0, no idlest group will be returned and the selected CPU will be a not allowed one (which will be replaced in select_fallback_rq by a random one). With a default value set to max, we will use the idlest group even if we skip the local_group. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f9b03c1..2d9f782 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3532,7 +3532,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu, int sd_flag) { struct sched_group *idlest = NULL, *group = sd->groups; - unsigned long min_load = ULONG_MAX, this_load = 0; + unsigned long min_load = ULONG_MAX, this_load = ULONG_MAX; int load_idx = sd->forkexec_idx; int imbalance = 100 + (sd->imbalance_pct-100)/2;