From patchwork Mon Feb 24 05:12:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25162 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 606B3203C3 for ; Mon, 24 Feb 2014 05:13:20 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id n16sf9248479oag.1 for ; Sun, 23 Feb 2014 21:13:19 -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=R+a9wXbKl1fIRUJpgTP53XJ/nqI7xGDlt9TDgF6xd+RsAaNgpWXFtKewLTsQDg/li7 SKpJXegN09gPLcrD9o+l9NgQqoxsszQZVm5NT+BaMUJzj0ZPohABXJREAekiOFG/rS9x Ze4uwKFBkwRWxGhxKZLaXP6E2+cvwW72D6nL9YI+TBPyBxTt8GWwlEddI6E6guWYAbuv IJoEjKhB8Bt2gZqD7MdwB9zgMJio0LixZOhDYYdCoRNSAf1JIAOXSs1c425y1aJgzZf0 XGAmC51GXx2Bh9FZlw0Dkiil2zhew4Zl5nLWcQ9HtmY4jXa0zn02vSMTjrPvDuEGVzsB 9/Kw== X-Gm-Message-State: ALoCoQllRdNWeD/fAuvjs3gVD5pTFbQ+fwLSdmaqcPRR6l75ehGMY2u6Rie/4Mf1lWShOT1X8iyk X-Received: by 10.43.135.4 with SMTP id ie4mr8918948icc.1.1393218799736; Sun, 23 Feb 2014 21:13:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.195 with SMTP id 61ls1847984qgv.19.gmail; Sun, 23 Feb 2014 21:13:19 -0800 (PST) X-Received: by 10.220.71.20 with SMTP id f20mr11436474vcj.70.1393218799591; Sun, 23 Feb 2014 21:13:19 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id sq4si5540079vdc.106.2014.02.23.21.13.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:13:19 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so5336824veb.41 for ; Sun, 23 Feb 2014 21:13:19 -0800 (PST) X-Received: by 10.52.164.39 with SMTP id yn7mr9439246vdb.25.1393218799508; Sun, 23 Feb 2014 21:13:19 -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 u4csp36563vcz; Sun, 23 Feb 2014 21:13:19 -0800 (PST) X-Received: by 10.66.252.135 with SMTP id zs7mr11662841pac.13.1393218798556; Sun, 23 Feb 2014 21:13:18 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tt8si15434509pbc.160.2014.02.23.21.13.17; Sun, 23 Feb 2014 21:13:17 -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 S1752252AbaBXFNG (ORCPT + 26 others); Mon, 24 Feb 2014 00:13:06 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:48849 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751604AbaBXFNC (ORCPT ); Mon, 24 Feb 2014 00:13:02 -0500 Received: by mail-pa0-f48.google.com with SMTP id kx10so6025172pab.7 for ; Sun, 23 Feb 2014 21:13:01 -0800 (PST) X-Received: by 10.66.231.40 with SMTP id td8mr11682656pac.103.1393218781485; Sun, 23 Feb 2014 21:13:01 -0800 (PST) Received: from localhost.localdomain ([162.243.130.63]) by mx.google.com with ESMTPSA id vn10sm45690743pbc.21.2014.02.23.21.12.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:13:00 -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 03/10] sched: clean up cpu_load update Date: Mon, 24 Feb 2014 13:12:18 +0800 Message-Id: <1393218745-8795-4-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.182 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); }