From patchwork Wed Apr 16 02:43: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: 28439 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 432E22057C for ; Wed, 16 Apr 2014 02:45:24 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id m5sf20745058qaj.1 for ; Tue, 15 Apr 2014 19:45:24 -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=4KOkaRuJ61uZhZWfixHxL8IkyBXbe+LnYHzXHRSNTRY=; b=hWJgFBEQmhE8BzjgsjAoH4thVIJlYRGJ2YdInbxFTSmyZ2mZ1Dhl6eOyML40N6mNTf R1UCBweF13lvknHco/IiunI4bdCvmYKSG2HnRezDun4J26AAt0pHD3gJndcvFYvEpXsn y9oeQhuCRVuWuJKxTyJm8b7P2fa0vkuxm4xZZYsaV/0p7xCL+RoCOjMr4wqtd84gPNaX iZsHolysYVCvGRoXK1YiwLWxN16jdpJlLdC7Ov/SU9+4Tmqpj2ef8uLLXl5841cZBGfd spzbuQ6o74KL/OUBJuw0U00sQfJO7vDxszHB99XDsop+zfl5/c+GCakpszfDWwjPOp6Q h8zQ== X-Gm-Message-State: ALoCoQkrwrRcuVRNIo4mYdvQ4rGT9mRRFI15QBR878CRyQWqvQgj3W1/nVeeUhWppA538CvXYym0 X-Received: by 10.58.46.240 with SMTP id y16mr2579036vem.2.1397616324200; Tue, 15 Apr 2014 19:45:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.39 with SMTP id y36ls173450qgd.82.gmail; Tue, 15 Apr 2014 19:45:24 -0700 (PDT) X-Received: by 10.236.116.131 with SMTP id g3mr8559401yhh.110.1397616324111; Tue, 15 Apr 2014 19:45:24 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id 74si21813662yho.72.2014.04.15.19.45.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:45:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so9857187vcb.5 for ; Tue, 15 Apr 2014 19:45:23 -0700 (PDT) X-Received: by 10.58.88.8 with SMTP id bc8mr43265veb.39.1397616323843; Tue, 15 Apr 2014 19:45:23 -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.221.72 with SMTP id ib8csp277727vcb; Tue, 15 Apr 2014 19:45:23 -0700 (PDT) X-Received: by 10.68.162.34 with SMTP id xx2mr5717871pbb.120.1397616323165; Tue, 15 Apr 2014 19:45:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si11858350pbc.200.2014.04.15.19.45.22; Tue, 15 Apr 2014 19:45:22 -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 S1751623AbaDPCol (ORCPT + 26 others); Tue, 15 Apr 2014 22:44:41 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:57536 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbaDPCoM (ORCPT ); Tue, 15 Apr 2014 22:44:12 -0400 Received: by mail-pa0-f49.google.com with SMTP id lj1so10345514pab.36 for ; Tue, 15 Apr 2014 19:44:12 -0700 (PDT) X-Received: by 10.66.241.66 with SMTP id wg2mr5698239pac.132.1397616251872; Tue, 15 Apr 2014 19:44:11 -0700 (PDT) Received: from alex-shi.Home ([116.232.95.240]) by mx.google.com with ESMTPSA id sv10sm43373627pbc.74.2014.04.15.19.44.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:44:11 -0700 (PDT) From: Alex Shi To: mingo@redhat.com, peterz@infradead.org, morten.rasmussen@arm.com, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, efault@gmx.de Cc: wangyun@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, mgorman@suse.de Subject: [PATCH V5 1/8] sched: shortcut to remove load_idx Date: Wed, 16 Apr 2014 10:43:22 +0800 Message-Id: <1397616209-27275-2-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1397616209-27275-1-git-send-email-alex.shi@linaro.org> References: <1397616209-27275-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.174 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 4f14a65..ddff32a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5507,34 +5507,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; @@ -5920,7 +5892,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;