From patchwork Mon Feb 24 05:12:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25165 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 527A3203C3 for ; Mon, 24 Feb 2014 05:14:04 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id kq14sf17688545pab.1 for ; Sun, 23 Feb 2014 21:14:03 -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=xfDFt/QTAke1Md6317WdP7SE+GvOEkXNdKGcvRAilRQ=; b=WrImZm+Y5JO9FnjWynUbJxYKFFAvCfFsH0/xiN9ElhiUMZe91RyZOoQRJexQKXMeeq 6zVg8UzJk2E3An8qxi7K326kD7BF7UxiHxH5X8VFog+kUS/VtMuv+ENwXbgCw63bIx7L tG6lFCVrk4TevSuEa/NYqwsrOJtK4319iIMx3CCCHmFkY6ys5BwJknBWGmORd0FStUHJ aVOCnCn4FmunizEXp/IGnkQ8cODpXEOFLr0sf7rYc0sFh9VW9U357oCVdi5FDuzXjNe5 PHsNuQ5b3YnRTgWahcIY6eDTlTgSVfkhTMkAXnhH52u9NOdoswp1lRRYeL18ZeqmYR1P 7HlA== X-Gm-Message-State: ALoCoQkOakweWWELsN5BAqfpzUOYWg8rs2rXYgNy6Gzvn8Uno3WqLQMg7vQWhPLpYdm4h8Ou9SBF X-Received: by 10.66.227.103 with SMTP id rz7mr9247117pac.37.1393218843541; Sun, 23 Feb 2014 21:14:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.241 with SMTP id t104ls1024204qgt.21.gmail; Sun, 23 Feb 2014 21:14:03 -0800 (PST) X-Received: by 10.52.117.115 with SMTP id kd19mr9485629vdb.15.1393218843366; Sun, 23 Feb 2014 21:14:03 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id si7si5555263vdc.11.2014.02.23.21.14.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:14:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 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.175; Received: by mail-ve0-f175.google.com with SMTP id oy12so960687veb.20 for ; Sun, 23 Feb 2014 21:14:03 -0800 (PST) X-Received: by 10.220.225.71 with SMTP id ir7mr11132159vcb.50.1393218843297; Sun, 23 Feb 2014 21:14:03 -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 u4csp36594vcz; Sun, 23 Feb 2014 21:14:02 -0800 (PST) X-Received: by 10.68.87.98 with SMTP id w2mr22891324pbz.2.1393218842328; Sun, 23 Feb 2014 21:14:02 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si15394413pbl.101.2014.02.23.21.14.01; Sun, 23 Feb 2014 21:14:01 -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 S1752545AbaBXFN0 (ORCPT + 26 others); Mon, 24 Feb 2014 00:13:26 -0500 Received: from mail-pb0-f53.google.com ([209.85.160.53]:64907 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752455AbaBXFNX (ORCPT ); Mon, 24 Feb 2014 00:13:23 -0500 Received: by mail-pb0-f53.google.com with SMTP id ma3so3380777pbc.40 for ; Sun, 23 Feb 2014 21:13:22 -0800 (PST) X-Received: by 10.68.138.165 with SMTP id qr5mr23032583pbb.123.1393218802398; Sun, 23 Feb 2014 21:13:22 -0800 (PST) Received: from localhost.localdomain ([162.243.130.63]) by mx.google.com with ESMTPSA id vn10sm45690743pbc.21.2014.02.23.21.13.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:13:21 -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 06/10] sched: clean up source_load/target_load Date: Mon, 24 Feb 2014 13:12:21 +0800 Message-Id: <1393218745-8795-7-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1393218745-8795-1-git-send-email-alex.shi@linaro.org> References: <1393218745-8795-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.128.175 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 5a3ea72..d91d925 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)