From patchwork Fri Oct 18 11:52:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 21121 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 39C82246F1 for ; Fri, 18 Oct 2013 11:53:56 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id rq2sf5814922pbb.11 for ; Fri, 18 Oct 2013 04:53:55 -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=0es3yZK5cF9h7lzyrEGAaU9HRi5GrWPI27CEiwCh7bM=; b=Wo/zF1BPUieti/56iMgFTZzbcoMX1We2VbX+6Pim9IuS5lii1K0Kn3mSuDGppNrIdF tjk/axvXPEJ69sIpgJv0cLYWtK5uPnv2TNhp2BZLbA4YJ9265/qSr0csyOXMMUhWfwdf Wwo6Wp7C/Dm4bZev2k7R9hF0cRMMwanXz4JR16pwndN8aqVMYzj4AIF+ldHCxtnjgLaw JUh+zHJGZPeJkKCB9Txo2gGnw5N5fPvm6Xbhx0fJ7cUXAQjf4EJ3fyhzDwjKRJXVGyZc G+NcIY2m1SLC3CJayP4rilEvkQx7Gf0zebFaZWa/than1yieZvGa1i0xsFO6oCO16Qyx AOng== X-Received: by 10.67.3.34 with SMTP id bt2mr1068721pad.41.1382097235550; Fri, 18 Oct 2013 04:53:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.2.166 with SMTP id 6ls1277250qev.69.gmail; Fri, 18 Oct 2013 04:53:55 -0700 (PDT) X-Received: by 10.52.230.102 with SMTP id sx6mr1453333vdc.15.1382097235382; Fri, 18 Oct 2013 04:53:55 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id sc5si229785vdc.87.2013.10.18.04.53.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:53:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id h11so1843695vbh.30 for ; Fri, 18 Oct 2013 04:53:55 -0700 (PDT) X-Gm-Message-State: ALoCoQmTWo5WPpTyTzir1FJ1T8LeVVIXEQM7ncsek0a+VwV27UVmbUnYYFFMqnWyN5N7g4my0I7J X-Received: by 10.52.119.228 with SMTP id kx4mr1482223vdb.12.1382097235299; Fri, 18 Oct 2013 04:53:55 -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 u4csp29487vcz; Fri, 18 Oct 2013 04:53:54 -0700 (PDT) X-Received: by 10.194.23.8 with SMTP id i8mr206621wjf.68.1382097234412; Fri, 18 Oct 2013 04:53:54 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id br10si422196wjc.71.2013.10.18.04.53.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:53:54 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.178; Received: by mail-we0-f178.google.com with SMTP id q59so3642283wes.9 for ; Fri, 18 Oct 2013 04:53:54 -0700 (PDT) X-Received: by 10.180.10.8 with SMTP id e8mr2057920wib.65.1382097233974; Fri, 18 Oct 2013 04:53:53 -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.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:53:53 -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 08/14] sched: move load idx selection in find_idlest_group Date: Fri, 18 Oct 2013 13:52:21 +0200 Message-Id: <1382097147-30088-8-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.212.43 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: , load_idx is used in find_idlest_group but initialized in select_task_rq_fair even when not used. The load_idx initialisation is moved in find_idlest_group and the sd_flag replaces it in the function's args. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7e26f65..c258c38 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3430,12 +3430,16 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) */ static struct sched_group * find_idlest_group(struct sched_domain *sd, struct task_struct *p, - int this_cpu, int load_idx) + int this_cpu, int sd_flag) { struct sched_group *idlest = NULL, *group = sd->groups; unsigned long min_load = ULONG_MAX, this_load = 0; + int load_idx = sd->forkexec_idx; int imbalance = 100 + (sd->imbalance_pct-100)/2; + if (sd_flag & SD_BALANCE_WAKE) + load_idx = sd->wake_idx; + do { unsigned long load, avg_load; int local_group, packing_cpus = 0; @@ -3632,7 +3636,6 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags) } while (sd) { - int load_idx = sd->forkexec_idx; struct sched_group *group; int weight; @@ -3641,10 +3644,7 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags) continue; } - if (sd_flag & SD_BALANCE_WAKE) - load_idx = sd->wake_idx; - - group = find_idlest_group(sd, p, cpu, load_idx); + group = find_idlest_group(sd, p, cpu, sd_flag); if (!group) { sd = sd->child; continue;