From patchwork Wed Apr 16 02:43: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: 28444 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6097F2036D for ; Wed, 16 Apr 2014 02:46:41 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf56809147iec.0 for ; Tue, 15 Apr 2014 19:46:40 -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=ishq7vnoYA2EcGIA0rVHeMbnwHzbWVim7YpVZjCFYxI=; b=b4BXO38ECic5Oko2E4jdi92MsIaduutyqZcwHCKidNzxi6ol6DyzvJMoHpc3FObsgb 6XYk//fopaao801H0SwarY0qZQfG/CYHKaFDXBjOoRrLy2T3WrLK6vpDEuo4a80mppNF VMJ8wI63C0BsFpoxzzNY/XvYI6n4K1lobrAugLJyYjINCqg72S5PYdrw2aeDyCB0J4Ar UQY8gcmQMCtxad6K7980c2J/MY4bCQP7+gDFq3dESwoFoemnmP6A0tk+JqRK28XKYeaf 1qnSt5aMC9OwaH5Gpty6FX9TmyDXOtVxuxDLLvKhaUBYKdFFIaQP45M04yS7Bufp1LmT h4Sg== X-Gm-Message-State: ALoCoQn0uDzDD2H77UpZiNxIHvCNqm6zl8cXEkJTCsHIZycN3DMdlR2lT39IFUjtnHAZtnJ9V/on X-Received: by 10.42.62.11 with SMTP id w11mr896884ich.29.1397616400756; Tue, 15 Apr 2014 19:46:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.100 with SMTP id b91ls464886qgf.26.gmail; Tue, 15 Apr 2014 19:46:40 -0700 (PDT) X-Received: by 10.236.138.73 with SMTP id z49mr8521150yhi.152.1397616400663; Tue, 15 Apr 2014 19:46:40 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id a6si21779316yhn.193.2014.04.15.19.46.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:46:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id db11so10150221veb.35 for ; Tue, 15 Apr 2014 19:46:40 -0700 (PDT) X-Received: by 10.220.106.84 with SMTP id w20mr55826vco.18.1397616400395; Tue, 15 Apr 2014 19:46:40 -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.221.72 with SMTP id ib8csp277770vcb; Tue, 15 Apr 2014 19:46:40 -0700 (PDT) X-Received: by 10.66.146.199 with SMTP id te7mr5716745pab.106.1397616399653; Tue, 15 Apr 2014 19:46:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ua2si11839388pab.36.2014.04.15.19.46.38; Tue, 15 Apr 2014 19:46:39 -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 S1752511AbaDPCp2 (ORCPT + 26 others); Tue, 15 Apr 2014 22:45:28 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:44660 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbaDPCog (ORCPT ); Tue, 15 Apr 2014 22:44:36 -0400 Received: by mail-pa0-f48.google.com with SMTP id hz1so10330596pad.21 for ; Tue, 15 Apr 2014 19:44:36 -0700 (PDT) X-Received: by 10.68.189.68 with SMTP id gg4mr5760848pbc.42.1397616276281; Tue, 15 Apr 2014 19:44:36 -0700 (PDT) Received: from alex-shi.Home ([116.232.95.240]) by mx.google.com with ESMTPSA id sv10sm43373627pbc.74.2014.04.15.19.44.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:44:35 -0700 (PDT) From: Alex Shi To: mingo@redhat.com, peterz@infradead.org, morten.rasmussen@arm.com, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, efault@gmx.de Cc: wangyun@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, mgorman@suse.de Subject: [PATCH V5 5/8] sched: clean up cpu_load update Date: Wed, 16 Apr 2014 10:43:26 +0800 Message-Id: <1397616209-27275-6-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1397616209-27275-1-git-send-email-alex.shi@linaro.org> References: <1397616209-27275-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.176 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); }