From patchwork Mon Feb 24 05:12:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25164 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 7351E203C3 for ; Mon, 24 Feb 2014 05:14:03 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id n16sf9230617oag.9 for ; Sun, 23 Feb 2014 21:14:02 -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=KDj+wOylYTHrr+ZQ9tObofi4lRGXd3JzdQxzFOzMkkY=; b=AZMX7h07Pl9VVhHOhAxuDYTjxXnadZy1MyanMEs2gBPZ+GP+QDdXkH8PGnk9IvVMCb hpYokiegu6W4f9gMXMS7RhYMqG5ndLf6M+m2WVeiS238IJiEpWtje1qQlSTt8x23cRtc hAI+r/cvOLI48TwVA0FqvKEErI+ljiXCusKKIo69+ul4YxDO6lUrLS58m8rWWESeUbJY suWBLbMWOmOM40epuWPPhNCZfgdCAhFbyDL4+rxYL8YwaP2y+gOjgEoNfquE/VlksKed eSBi/tpHsYP3/PVk3ymIB3O1Mwza+7vdSQcKKoeeMAvSNkS/J8A+xcLLYXxJgN0txYC0 f1bg== X-Gm-Message-State: ALoCoQlSwKG62eccquEvCzUqiKyASwB7aJuzSWHz3maVufgkNpg2mlBlgYomJtBWaZJ6qy+KBqJF X-Received: by 10.50.56.39 with SMTP id x7mr8503138igp.6.1393218842829; Sun, 23 Feb 2014 21:14:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.130 with SMTP id u2ls1883421qga.34.gmail; Sun, 23 Feb 2014 21:14:02 -0800 (PST) X-Received: by 10.221.53.194 with SMTP id vr2mr11361233vcb.41.1393218842712; Sun, 23 Feb 2014 21:14:02 -0800 (PST) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id cx4si5558093vcb.80.2014.02.23.21.14.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:14:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id if11so5312428vcb.36 for ; Sun, 23 Feb 2014 21:14:02 -0800 (PST) X-Received: by 10.221.26.10 with SMTP id rk10mr11443711vcb.0.1393218842625; Sun, 23 Feb 2014 21:14:02 -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 u4csp36593vcz; Sun, 23 Feb 2014 21:14:02 -0800 (PST) X-Received: by 10.69.26.103 with SMTP id ix7mr22883760pbd.41.1393218841594; Sun, 23 Feb 2014 21:14:01 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si15394413pbl.101.2014.02.23.21.14.00; Sun, 23 Feb 2014 21:14:01 -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 S1752492AbaBXFNW (ORCPT + 26 others); Mon, 24 Feb 2014 00:13:22 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:65139 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316AbaBXFNR (ORCPT ); Mon, 24 Feb 2014 00:13:17 -0500 Received: by mail-pb0-f42.google.com with SMTP id rr13so1497178pbb.29 for ; Sun, 23 Feb 2014 21:13:16 -0800 (PST) X-Received: by 10.66.162.74 with SMTP id xy10mr23185105pab.4.1393218796163; Sun, 23 Feb 2014 21:13:16 -0800 (PST) Received: from localhost.localdomain ([162.243.130.63]) by mx.google.com with ESMTPSA id vn10sm45690743pbc.21.2014.02.23.21.13.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 21:13:15 -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 05/10] sched: rewrite update_cpu_load_nohz Date: Mon, 24 Feb 2014 13:12:20 +0800 Message-Id: <1393218745-8795-6-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.220.177 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 */