From patchwork Mon Feb 17 01:55:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 24723 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 88358203BE for ; Mon, 17 Feb 2014 01:56:42 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id kq14sf35728075pab.9 for ; Sun, 16 Feb 2014 17:56:41 -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=beDqPC43JWMRpiCPm/SWQ6g1//Ddtofsjk3Vh5GAsEjo4QpoTmfX4DfP2XBGdVBjCi t+I2+o5rKMUbK3RMlsEhVgo3DH8DYya0zqnQpR4j22D62xPwmSbkxJjIaCOUrjYwz+iw vFCzg+e3wq4++OHPQWUGTtSlfb8W1URbPUJA8WzwlQfah4xU1b9IylQS2ZVOFq7xHf4R W0SBbBNUhu4YbIEe4pQeLasZSe+tLhfPevZDNuspRTlkcBum8IFascxArSePCTdfWSSa Sz8I7iv84ueBaESrTBIBEOUx72DPW4vUGo28UowAS9Jgu/7Euzsa8EAOG3/jHS7YHFUI HLLA== X-Gm-Message-State: ALoCoQnsb2mtnoKVFGZsJmrZBtEars999Z7CV+H3tFOz5OI4c1jmNVOG6Ew6ZxaS4OXYR8r80ANw X-Received: by 10.66.246.194 with SMTP id xy2mr9146476pac.36.1392602201473; Sun, 16 Feb 2014 17:56:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.209 with SMTP id f75ls792727qgd.48.gmail; Sun, 16 Feb 2014 17:56:41 -0800 (PST) X-Received: by 10.221.34.211 with SMTP id st19mr15039086vcb.5.1392602201293; Sun, 16 Feb 2014 17:56:41 -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 n8si4163539vdv.68.2014.02.16.17.56.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:56:41 -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 cz12so11658851veb.15 for ; Sun, 16 Feb 2014 17:56:41 -0800 (PST) X-Received: by 10.52.94.77 with SMTP id da13mr125521vdb.55.1392602201145; Sun, 16 Feb 2014 17:56:41 -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 u4csp102380vcz; Sun, 16 Feb 2014 17:56:40 -0800 (PST) X-Received: by 10.66.121.164 with SMTP id ll4mr23147453pab.129.1392602200276; Sun, 16 Feb 2014 17:56:40 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qx4si13007287pbc.315.2014.02.16.17.56.39; Sun, 16 Feb 2014 17:56:39 -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 S1753975AbaBQB40 (ORCPT + 27 others); Sun, 16 Feb 2014 20:56:26 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:47744 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753127AbaBQB4X (ORCPT ); Sun, 16 Feb 2014 20:56:23 -0500 Received: by mail-pb0-f48.google.com with SMTP id rr13so14592471pbb.21 for ; Sun, 16 Feb 2014 17:56:22 -0800 (PST) X-Received: by 10.68.170.66 with SMTP id ak2mr23398547pbc.5.1392602182532; Sun, 16 Feb 2014 17:56:22 -0800 (PST) Received: from localhost.localdomain ([116.232.92.15]) by mx.google.com with ESMTPSA id eo11sm104524083pac.0.2014.02.16.17.56.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:56: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 v2 03/11] sched: clean up cpu_load update Date: Mon, 17 Feb 2014 09:55:09 +0800 Message-Id: <1392602117-20773-4-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.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: , 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); }