From patchwork Tue Feb 25 01:50:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25224 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A81142066E for ; Tue, 25 Feb 2014 01:51:58 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wp4sf14444895obc.7 for ; Mon, 24 Feb 2014 17:51:58 -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=104rq4IrW5lTtLAIZGHRZA7DGs+V+nKuIV0M0cFQKRQ=; b=PnKAEnCMlY4nKIJUdZW8Rk7Bw/A6GA6+g0naqeODWsly403hCF5h+CkL0jfa0tybPI 64NnGR1DxAOWcQfKnbuCXpkLu9RXK4g7jsFdwS/smQq2f35DTEa8FCMLrdZYHP4zXfmi eeR2OjBIbsY8jq/3Mx6SuHpZ5ZG7UPXEgNuvst53TRsksqTjZsa7OHNCvGZq1sqVqIxV yvey6vI3FaieyLTYcQ9UOEqwBFYJzqQrNokOge4Zvuh9ohmmY1SfXJ9hFtz8xIaGQaY8 PYdksqcHVyEWcyPRmgqjK+cj5N9XsRYSxU+qaG3sdbEMvQn38hZ95SzTGN2Ubd1n7ABA LPkA== X-Gm-Message-State: ALoCoQkJE4BBgvy8KD1NEii2q+UzQtcnVth1gr9kYXBbJnQZ1kNAG0CXi+pw3NH1j+OAOK63OTVX X-Received: by 10.182.116.39 with SMTP id jt7mr10608148obb.33.1393293118159; Mon, 24 Feb 2014 17:51:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.70 with SMTP id u64ls1375113qgd.86.gmail; Mon, 24 Feb 2014 17:51:58 -0800 (PST) X-Received: by 10.58.134.101 with SMTP id pj5mr59051veb.38.1393293118004; Mon, 24 Feb 2014 17:51:58 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id yv5si6407289veb.140.2014.02.24.17.51.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:51:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.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.128.174; Received: by mail-ve0-f174.google.com with SMTP id oy12so1925725veb.5 for ; Mon, 24 Feb 2014 17:51:57 -0800 (PST) X-Received: by 10.58.229.4 with SMTP id sm4mr337704vec.10.1393293117897; Mon, 24 Feb 2014 17:51:57 -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 u4csp103153vcz; Mon, 24 Feb 2014 17:51:56 -0800 (PST) X-Received: by 10.66.227.104 with SMTP id rz8mr28968907pac.74.1393293115355; Mon, 24 Feb 2014 17:51:55 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zo6si1841622pbc.73.2014.02.24.17.51.54; Mon, 24 Feb 2014 17:51:54 -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 S1753342AbaBYBvt (ORCPT + 26 others); Mon, 24 Feb 2014 20:51:49 -0500 Received: from mail-pb0-f54.google.com ([209.85.160.54]:44444 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752732AbaBYBvq (ORCPT ); Mon, 24 Feb 2014 20:51:46 -0500 Received: by mail-pb0-f54.google.com with SMTP id uo5so7427486pbc.27 for ; Mon, 24 Feb 2014 17:51:46 -0800 (PST) X-Received: by 10.68.106.130 with SMTP id gu2mr3145648pbb.59.1393293106558; Mon, 24 Feb 2014 17:51:46 -0800 (PST) Received: from localhost.localdomain ([116.232.61.20]) by mx.google.com with ESMTPSA id q7sm4499844pbc.20.2014.02.24.17.51.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:51:45 -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 03/11] sched: clean up cpu_load update Date: Tue, 25 Feb 2014 09:50:46 +0800 Message-Id: <1393293054-11378-4-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.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: , Since we don't decay the rq->cpu_load, so we don't need the pending_updates. But we still want update rq->rt_avg, so still keep rq->last_load_update_tick and func __update_cpu_load. Signed-off-by: Alex Shi --- kernel/sched/proc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kernel/sched/proc.c b/kernel/sched/proc.c index a2435c5..057bb9b 100644 --- a/kernel/sched/proc.c +++ b/kernel/sched/proc.c @@ -404,8 +404,7 @@ static void calc_load_account_active(struct rq *this_rq) * scheduler tick (TICK_NSEC). With tickless idle this will not be called * every tick. We fix it up based on jiffies. */ -static void __update_cpu_load(struct rq *this_rq, unsigned long this_load, - unsigned long pending_updates) +static void __update_cpu_load(struct rq *this_rq, unsigned long this_load) { this_rq->nr_load_updates++; @@ -449,7 +448,6 @@ void update_idle_cpu_load(struct rq *this_rq) { unsigned long curr_jiffies = ACCESS_ONCE(jiffies); unsigned long load = get_rq_runnable_load(this_rq); - unsigned long pending_updates; /* * bail if there's load or we're actually up-to-date. @@ -457,10 +455,9 @@ void update_idle_cpu_load(struct rq *this_rq) if (load || curr_jiffies == this_rq->last_load_update_tick) return; - pending_updates = curr_jiffies - this_rq->last_load_update_tick; this_rq->last_load_update_tick = curr_jiffies; - __update_cpu_load(this_rq, load, pending_updates); + __update_cpu_load(this_rq, load); } /* @@ -483,7 +480,7 @@ void update_cpu_load_nohz(void) * We were idle, this means load 0, the current load might be * !0 due to remote wakeups and the sort. */ - __update_cpu_load(this_rq, 0, pending_updates); + __update_cpu_load(this_rq, 0); } raw_spin_unlock(&this_rq->lock); } @@ -499,7 +496,7 @@ void update_cpu_load_active(struct rq *this_rq) * See the mess around update_idle_cpu_load() / update_cpu_load_nohz(). */ this_rq->last_load_update_tick = jiffies; - __update_cpu_load(this_rq, load, 1); + __update_cpu_load(this_rq, load); calc_load_account_active(this_rq); }