From patchwork Mon Feb 17 01:55:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 24726 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1EA6E203BE for ; Mon, 17 Feb 2014 01:57:09 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf35532454pab.7 for ; Sun, 16 Feb 2014 17:57:08 -0800 (PST) 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=LqUID4DzcazO2A2DEDoiMZPrUrWXFC5SwJfrShImhyw=; b=GmtfZxmd5BpB8wVp59R2zrB5PW2cilYJLtSkcJoUkbQHUqOARpEWi2EoSRUT0HWDOJ N8LQAR2Z8HCMzHgYVT934EJ+SmZZ7CNZzIxBDcRuiEe6+j0PI9FujNmJ1reNsxd3mjOR 46qZsUhBxNguOgDD86H3UnDme/oBdrkXzUchyEa/Lm6yQYuhwo5vQ9nAw6fhl1me3H9T zn/zjqOEHW95ldpyI8p3ZEk2wrX670NMUevnLsd85+MmKgLeAZQ0ip2sqQoKZJ8lDNkB 6ABWAzMLWbJYin8Qol2awENUFnhEjbCmGhSm/JJ15Q2zUOJNdPtk4t64rOwJ6+Fj7ENa Fphg== X-Gm-Message-State: ALoCoQkp4dtUFrosrHcl6FHLD/HoAc5b5LGI0mSBXhJeuaRVl3FQNIp6VIhAVL3Qo2z4A64UWWA/ X-Received: by 10.66.253.9 with SMTP id zw9mr9827976pac.38.1392602228369; Sun, 16 Feb 2014 17:57:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.71 with SMTP id d65ls704734qgf.60.gmail; Sun, 16 Feb 2014 17:57:08 -0800 (PST) X-Received: by 10.52.247.231 with SMTP id yh7mr2471050vdc.34.1392602228217; Sun, 16 Feb 2014 17:57:08 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id f7si4161895vcz.132.2014.02.16.17.57.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:57:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id hu8so11362943vcb.29 for ; Sun, 16 Feb 2014 17:57:08 -0800 (PST) X-Received: by 10.52.99.227 with SMTP id et3mr160613vdb.53.1392602228143; Sun, 16 Feb 2014 17:57:08 -0800 (PST) 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.174.196 with SMTP id u4csp102399vcz; Sun, 16 Feb 2014 17:57:07 -0800 (PST) X-Received: by 10.68.98.3 with SMTP id ee3mr23575311pbb.31.1392602227341; Sun, 16 Feb 2014 17:57:07 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tq5si13008155pac.327.2014.02.16.17.57.06; Sun, 16 Feb 2014 17:57:06 -0800 (PST) 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 S1754039AbaBQB5A (ORCPT + 27 others); Sun, 16 Feb 2014 20:57:00 -0500 Received: from mail-pb0-f51.google.com ([209.85.160.51]:63844 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbaBQB46 (ORCPT ); Sun, 16 Feb 2014 20:56:58 -0500 Received: by mail-pb0-f51.google.com with SMTP id un15so14660989pbc.38 for ; Sun, 16 Feb 2014 17:56:57 -0800 (PST) X-Received: by 10.68.218.3 with SMTP id pc3mr23632818pbc.71.1392602217709; Sun, 16 Feb 2014 17:56:57 -0800 (PST) Received: from localhost.localdomain ([116.232.92.15]) by mx.google.com with ESMTPSA id eo11sm104524083pac.0.2014.02.16.17.56.45 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:56:57 -0800 (PST) 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 Subject: [PATCH v2 06/11] sched: clean up source_load/target_load Date: Mon, 17 Feb 2014 09:55:12 +0800 Message-Id: <1392602117-20773-7-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1392602117-20773-1-git-send-email-alex.shi@linaro.org> References: <1392602117-20773-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.170 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: , Don't need 'rq' variable now. Signed-off-by: Alex Shi --- kernel/sched/fair.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a85a10b..2da0e3b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3954,13 +3954,7 @@ static unsigned long weighted_cpuload(const int cpu) */ static unsigned long source_load(int cpu) { - struct rq *rq = cpu_rq(cpu); - unsigned long total = weighted_cpuload(cpu); - - if (!sched_feat(LB_BIAS)) - return total; - - return min(rq->cpu_load, total); + return weighted_cpuload(cpu); } /* @@ -3969,7 +3963,6 @@ static unsigned long source_load(int cpu) */ static unsigned long target_load(int cpu, int imbalance_pct) { - struct rq *rq = cpu_rq(cpu); unsigned long total = weighted_cpuload(cpu); if (!sched_feat(LB_BIAS)) @@ -3978,9 +3971,7 @@ static unsigned long target_load(int cpu, int imbalance_pct) /* * Bias target load with imbalance_pct. */ - total = total * imbalance_pct / 100; - - return max(rq->cpu_load, total); + return total * imbalance_pct / 100; } static unsigned long power_of(int cpu)