From patchwork Thu Mar 13 05:57:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 26172 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2FEA1236AC for ; Thu, 13 Mar 2014 06:04:51 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id r5sf1299555qcx.5 for ; Wed, 12 Mar 2014 23:04:50 -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=KDj+wOylYTHrr+ZQ9tObofi4lRGXd3JzdQxzFOzMkkY=; b=h/7+Uo1TJS/4OyJc6WXw5f31qAajZHMVIJm/nfy7Dlj0wg5dvPcUUT+M/UMBx1zKyN HUflzbFCP3HfsS7NrVa7+styvMllUp/D22ExSVRQ8rrQJLtSW2RKzrljpOox+bQfQmGD XRKTQm/qMyIMDI5/SEZ6GFormiFQBMSOF+t6Aje9lKj7Q/b/p/3P8QufgTCMOzM99MwS e+oH7FjOzvmB6zSxMnAjhdqO8IDq6gQKqrawNQjwYssbozMGfJr1L9fZzrkAIMdFxz1E vHyNLf/oqFsPCjogdNBAfpbiomXUAnmfB3g4H0Kics2ZDGI370Div+nkiOVkxONpgiKp PrXw== X-Gm-Message-State: ALoCoQmKqzkHe0hqsLTineNOf02GKognFHdU6xkwfnvbCG6gHt0nYIC46qnUm0HFlkPvFtdW7IWc X-Received: by 10.236.41.234 with SMTP id h70mr22277yhb.42.1394690690918; Wed, 12 Mar 2014 23:04:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.130 with SMTP id u2ls141429qga.34.gmail; Wed, 12 Mar 2014 23:04:50 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr44892vcb.2.1394690690808; Wed, 12 Mar 2014 23:04:50 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id rx10si53458vdc.136.2014.03.12.23.04.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:04:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id im17so578889vcb.23 for ; Wed, 12 Mar 2014 23:04:50 -0700 (PDT) X-Received: by 10.52.107.35 with SMTP id gz3mr35983vdb.8.1394690690676; Wed, 12 Mar 2014 23:04:50 -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 i9csp343329vck; Wed, 12 Mar 2014 23:04:50 -0700 (PDT) X-Received: by 10.66.231.104 with SMTP id tf8mr134851pac.48.1394690689695; Wed, 12 Mar 2014 23:04:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si603588pab.3.2014.03.12.23.04.48; Wed, 12 Mar 2014 23:04:49 -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 S1753014AbaCMGEm (ORCPT + 26 others); Thu, 13 Mar 2014 02:04:42 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:51067 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237AbaCMGEk (ORCPT ); Thu, 13 Mar 2014 02:04:40 -0400 Received: by mail-pb0-f48.google.com with SMTP id md12so621387pbc.35 for ; Wed, 12 Mar 2014 23:04:40 -0700 (PDT) X-Received: by 10.68.202.194 with SMTP id kk2mr53188pbc.156.1394690680522; Wed, 12 Mar 2014 23:04:40 -0700 (PDT) Received: from localhost.localdomain ([116.232.110.156]) by mx.google.com with ESMTPSA id ix2sm3136331pbc.45.2014.03.12.23.03.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:04:39 -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 6/8] sched: rewrite update_cpu_load_nohz Date: Thu, 13 Mar 2014 13:57:27 +0800 Message-Id: <1394690249-14130-7-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.178 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: , After change to sched_avg, the cpu load in idle exit was decayed. So, it maybe near zero if waking a long time sleep task, or, a full non-decay load if waking a new forked task. Then, we can use it to reflect the cpu load, don't need to pretend 0. Signed-off-by: Alex Shi --- kernel/sched/proc.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/kernel/sched/proc.c b/kernel/sched/proc.c index 057bb9b..383c4ba 100644 --- a/kernel/sched/proc.c +++ b/kernel/sched/proc.c @@ -461,28 +461,13 @@ void update_idle_cpu_load(struct rq *this_rq) } /* - * Called from tick_nohz_idle_exit() -- try and fix up the ticks we missed. + * Called from tick_nohz_idle_exit() */ void update_cpu_load_nohz(void) { struct rq *this_rq = this_rq(); - unsigned long curr_jiffies = ACCESS_ONCE(jiffies); - unsigned long pending_updates; - - if (curr_jiffies == this_rq->last_load_update_tick) - return; - raw_spin_lock(&this_rq->lock); - pending_updates = curr_jiffies - this_rq->last_load_update_tick; - if (pending_updates) { - this_rq->last_load_update_tick = curr_jiffies; - /* - * 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); - } - raw_spin_unlock(&this_rq->lock); + update_idle_cpu_load(this_rq); } #endif /* CONFIG_NO_HZ */