From patchwork Tue Feb 25 01:50:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25227 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1EB532066E for ; Tue, 25 Feb 2014 01:52:36 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id x13sf3730216qcv.9 for ; Mon, 24 Feb 2014 17:52:36 -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=sGpctnHeVnrZRIz4YN30udV6H4qk0VIzhRJedHccpOA=; b=cJg8VK2GHclyDFw5UjXmT9d+TQQdwQYYVaSPu+lOviQ5urNGjSgdTHjTu7ec22yqZ1 PvJZDx3r/PROYHu1woohobKNbHdg2KST2d223jIZrJ96STHKLXz6UUBwFkYpo+kNtxqE FVVODPVmu5m6/39MKaDsio8gyrQRJS+04inP4dABN/eINTjstrvtb1flpKaIEdS7LF0n zuzcZyYQBdbGFhE/JxjGLF8Oyu9IcfavpdTDbMzCYLjTO1SRMAzhS3trsGFoU/PDpu+2 QiKM3xoxlzHjp8wd+tl2agrrNgU+L3re+xMmyp5VRWPowilmSs7/ylA3drEaEhLvDfv4 kc9A== X-Gm-Message-State: ALoCoQkB4tjUE1blt3H5R5h+J8yMIVAKZOAFOYkgzOyDk4cr0rtxS7yzbdSaZaFvC5PjujqLU43f X-Received: by 10.236.65.136 with SMTP id f8mr923102yhd.11.1393293156819; Mon, 24 Feb 2014 17:52:36 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.116 with SMTP id g107ls2161802qgg.49.gmail; Mon, 24 Feb 2014 17:52:36 -0800 (PST) X-Received: by 10.221.66.73 with SMTP id xp9mr139930vcb.27.1393293156683; Mon, 24 Feb 2014 17:52:36 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id ug9si6424560vcb.32.2014.02.24.17.52.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:52:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.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.128.170; Received: by mail-ve0-f170.google.com with SMTP id c14so2283906vea.1 for ; Mon, 24 Feb 2014 17:52:36 -0800 (PST) X-Received: by 10.220.131.210 with SMTP id y18mr15170268vcs.12.1393293156590; Mon, 24 Feb 2014 17:52:36 -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 u4csp103189vcz; Mon, 24 Feb 2014 17:52:35 -0800 (PST) X-Received: by 10.66.191.42 with SMTP id gv10mr28818812pac.125.1393293154580; Mon, 24 Feb 2014 17:52:34 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yf8si18852169pab.323.2014.02.24.17.52.33; Mon, 24 Feb 2014 17:52:33 -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 S1753456AbaBYBwY (ORCPT + 26 others); Mon, 24 Feb 2014 20:52:24 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:37986 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752212AbaBYBwV (ORCPT ); Mon, 24 Feb 2014 20:52:21 -0500 Received: by mail-pa0-f47.google.com with SMTP id kp14so7373007pab.20 for ; Mon, 24 Feb 2014 17:52:20 -0800 (PST) X-Received: by 10.66.145.166 with SMTP id sv6mr29238644pab.31.1393293140708; Mon, 24 Feb 2014 17:52:20 -0800 (PST) Received: from localhost.localdomain ([116.232.61.20]) by mx.google.com with ESMTPSA id q7sm4499844pbc.20.2014.02.24.17.52.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:52:20 -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, mgorman@suse.de Subject: [PATCH 06/11] sched: clean up source_load/target_load Date: Tue, 25 Feb 2014 09:50:49 +0800 Message-Id: <1393293054-11378-7-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1393293054-11378-1-git-send-email-alex.shi@linaro.org> References: <1393293054-11378-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.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 d7093ee..c5821b5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3964,13 +3964,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); } /* @@ -3979,7 +3973,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)) @@ -3988,9 +3981,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)