From patchwork Thu Mar 13 05:57:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 26167 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 62440236AC for ; Thu, 13 Mar 2014 06:00:44 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf2060804iec.10 for ; Wed, 12 Mar 2014 23:00:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=MnZb5U0S9nuqSTFaArR8wAjcdlVtp3yP8zZsX6Ua5+4=; b=fP/CnYaotCTPsoyH2Jy+k6VHonBxGJTg/V5hjY/rEQ29KJrsc1vDvVmkpuaKfbKhV+ 7i+Af0n4qivgnbbZAitreb6xTPbLyxKORB3aqDFvRKWICY0D6AU9fozlTdlORHFkufbY s3CnR1NVHaUXo6dNa9s6sAO1xTFVF/EfE8CqT9P6yA7gMXhnxMHww0GWfNGWCNztFIzF QYr1nKgD/wVWlYis+NKTdeVfYfy0l76oBaHVRDvQq193I+Grqqd69NJB6qfSiAeEahpR 4tjCdoJ3/lc+OKC9e5YlIP2gLtSvgP6Qep3ReaxqLhMcmDWdlO3JcWF9GQBNdkwmBeen LA7Q== X-Gm-Message-State: ALoCoQmSxQMGRux2KR3JhaxZX9zcUje2oE83XwFTUidJWKWSbJnyqHG2mP0jd1fbujuLL+LGpYjW X-Received: by 10.42.107.146 with SMTP id d18mr32689icp.8.1394690443697; Wed, 12 Mar 2014 23:00:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.113 with SMTP id p104ls176607qga.41.gmail; Wed, 12 Mar 2014 23:00:43 -0700 (PDT) X-Received: by 10.58.170.69 with SMTP id ak5mr29443vec.28.1394690443611; Wed, 12 Mar 2014 23:00:43 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id q1si458941ves.9.2014.03.12.23.00.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:00:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so581837vcb.14 for ; Wed, 12 Mar 2014 23:00:43 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr34530vcb.16.1394690443503; Wed, 12 Mar 2014 23:00:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp343139vck; Wed, 12 Mar 2014 23:00:43 -0700 (PDT) X-Received: by 10.66.156.137 with SMTP id we9mr127389pab.30.1394690442097; Wed, 12 Mar 2014 23:00:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mt5si1102523pbb.246.2014.03.12.23.00.41; Wed, 12 Mar 2014 23:00:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373AbaCMGAe (ORCPT + 26 others); Thu, 13 Mar 2014 02:00:34 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:56710 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbaCMGAc (ORCPT ); Thu, 13 Mar 2014 02:00:32 -0400 Received: by mail-pb0-f50.google.com with SMTP id md12so619142pbc.23 for ; Wed, 12 Mar 2014 23:00:32 -0700 (PDT) X-Received: by 10.66.123.5 with SMTP id lw5mr1986903pab.83.1394690432195; Wed, 12 Mar 2014 23:00:32 -0700 (PDT) Received: from localhost.localdomain ([116.232.110.156]) by mx.google.com with ESMTPSA id ix2sm3136331pbc.45.2014.03.12.22.58.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:00:31 -0700 (PDT) From: Alex Shi To: mingo@redhat.com, peterz@infradead.org, morten.rasmussen@arm.com Cc: vincent.guittot@linaro.org, daniel.lezcano@linaro.org, fweisbec@gmail.com, linux@arm.linux.org.uk, tony.luck@intel.com, fenghua.yu@intel.com, james.hogan@imgtec.com, alex.shi@linaro.org, jason.low2@hp.com, viresh.kumar@linaro.org, hanjun.guo@linaro.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, akpm@linux-foundation.org, arjan@linux.intel.com, pjt@google.com, fengguang.wu@intel.com, linaro-kernel@lists.linaro.org, wangyun@linux.vnet.ibm.com, mgorman@suse.de Subject: [PATCH 1/8] sched: shortcut to remove load_idx Date: Thu, 13 Mar 2014 13:57:22 +0800 Message-Id: <1394690249-14130-2-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1394690249-14130-1-git-send-email-alex.shi@linaro.org> References: <1394690249-14130-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.shi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Shortcut to remove rq->cpu_load[load_idx] effect in scheduler. In five load idx, only busy_idx, idle_idx are not zero. Newidle_idx, wake_idx and fork_idx are all zero in all archs. So, change the idx to zero here can fully remove load_idx effect. Signed-off-by: Alex Shi --- kernel/sched/fair.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7e9bd0b..1d8a908 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5506,34 +5506,6 @@ static inline void init_sd_lb_stats(struct sd_lb_stats *sds) }; } -/** - * get_sd_load_idx - Obtain the load index for a given sched domain. - * @sd: The sched_domain whose load_idx is to be obtained. - * @idle: The idle status of the CPU for whose sd load_idx is obtained. - * - * Return: The load index. - */ -static inline int get_sd_load_idx(struct sched_domain *sd, - enum cpu_idle_type idle) -{ - int load_idx; - - switch (idle) { - case CPU_NOT_IDLE: - load_idx = sd->busy_idx; - break; - - case CPU_NEWLY_IDLE: - load_idx = sd->newidle_idx; - break; - default: - load_idx = sd->idle_idx; - break; - } - - return load_idx; -} - static unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu) { return SCHED_POWER_SCALE; @@ -5919,7 +5891,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd if (child && child->flags & SD_PREFER_SIBLING) prefer_sibling = 1; - load_idx = get_sd_load_idx(env->sd, env->idle); + load_idx = 0; do { struct sg_lb_stats *sgs = &tmp_sgs;