From patchwork Thu Mar 13 05:57:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 26171 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 34BF6236AC for ; Thu, 13 Mar 2014 06:03:49 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wn1sf2173414obc.9 for ; Wed, 12 Mar 2014 23:03:48 -0700 (PDT) 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=mqTOofxjV4168/hglEKy05WLyufwMziK27WSGPQKNnwYt4KTF8UqjyNQYA8KWZ1R+o k32HHAyBHjruL6r1zoGcEGN8/ikvIM0+X6HQdfOToHM8yKiZ9iSnQZ6pfRhqqTK35V1Y iwz/kNHkC4xx9Pml1oXQi7KQMR/AyDUkay4sbOVFjWUDNICrh5MRf0Tfj/VkGyqGahH0 HBETLQNI6N3kdz4iNoWUHhGci5wbVmcStEL8mTIHh4eXKNp8YeYZ//PRCAVieYOKtExp hVL3xTIMKF/2vUq73+cCxwHJMWwaOuK8P25cmHOf66DfVGT8HwGjt3mnMVpOYQyRV3BO uURw== X-Gm-Message-State: ALoCoQnLQOI4ZfF/Wz75r0jVF24qc+24W2rTL/QYCpxzO7+EcUYlN3JdfdI1xIq9+el2frFnDorQ X-Received: by 10.182.186.73 with SMTP id fi9mr70056obc.48.1394690628781; Wed, 12 Mar 2014 23:03:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.169 with SMTP id j38ls172574qgd.10.gmail; Wed, 12 Mar 2014 23:03:48 -0700 (PDT) X-Received: by 10.220.209.197 with SMTP id gh5mr149836vcb.65.1394690628690; Wed, 12 Mar 2014 23:03:48 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id oj4si425718vcb.50.2014.03.12.23.03.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:03:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.170; Received: by mail-vc0-f170.google.com with SMTP id hu19so588311vcb.29 for ; Wed, 12 Mar 2014 23:03:48 -0700 (PDT) X-Received: by 10.58.162.168 with SMTP id yb8mr6693veb.9.1394690628571; Wed, 12 Mar 2014 23:03:48 -0700 (PDT) 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.78.9 with SMTP id i9csp343286vck; Wed, 12 Mar 2014 23:03:48 -0700 (PDT) X-Received: by 10.68.194.97 with SMTP id hv1mr40847pbc.162.1394690627639; Wed, 12 Mar 2014 23:03:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nv9si1137679pbb.95.2014.03.12.23.03.46; Wed, 12 Mar 2014 23:03:47 -0700 (PDT) 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 S1753339AbaCMGDk (ORCPT + 26 others); Thu, 13 Mar 2014 02:03:40 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:39858 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbaCMGDj (ORCPT ); Thu, 13 Mar 2014 02:03:39 -0400 Received: by mail-pa0-f49.google.com with SMTP id lj1so625241pab.22 for ; Wed, 12 Mar 2014 23:03:38 -0700 (PDT) X-Received: by 10.66.142.107 with SMTP id rv11mr23089pab.17.1394690618749; Wed, 12 Mar 2014 23:03:38 -0700 (PDT) Received: from localhost.localdomain ([116.232.110.156]) by mx.google.com with ESMTPSA id ix2sm3136331pbc.45.2014.03.12.23.03.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:03:38 -0700 (PDT) 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 5/8] sched: clean up cpu_load update Date: Thu, 13 Mar 2014 13:57:26 +0800 Message-Id: <1394690249-14130-6-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1394690249-14130-1-git-send-email-alex.shi@linaro.org> References: <1394690249-14130-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.220.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); }