From patchwork Tue Feb 25 01:50:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 25226 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0ED252066E for ; Tue, 25 Feb 2014 01:52:26 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id ma3sf13600838pbc.0 for ; Mon, 24 Feb 2014 17:52:25 -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=COyA1ocEGKhVT4gFYoJsJ7eKElt0qvtLeGbdz/xaX3mEUAIUOjW6xOQiG1apNOIUS7 1zpeyyTU01tmjdGzdbjBPAamX7pq4C7rLD9V+vNpAK3OQfGeYK3kEmZ+eRsfXuC8QQKU cPIv5tWkMwwhAaGSPqBVF5JSuCB1b9nGafmNy7aCAeKb3Jf0RO+7KeuuK+qLNzu+9Kdc Rp54sJiUqe4kcZqJ1wDPOxPlRCSaH7ccc2oTOG9p2vLm/0dMQNTCOWFEBw4g2iZE/Xwy aPgGxqvTZm8Te3s+ZfjykZ/aKFa2V+yuwCIuIJ0QbeonfrB0eVyLw47kDehjjEGmrAsf B1lQ== X-Gm-Message-State: ALoCoQkAL1YYZTcAJGAA7W6cJgojhh/N9n025CBqWT4ujcrvJjZYWL7exLzoK2A2LFyyozBwuwNw X-Received: by 10.66.166.199 with SMTP id zi7mr13856616pab.30.1393293145571; Mon, 24 Feb 2014 17:52:25 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.7 with SMTP id 7ls1405156qgm.46.gmail; Mon, 24 Feb 2014 17:52:25 -0800 (PST) X-Received: by 10.52.135.65 with SMTP id pq1mr12551827vdb.13.1393293145356; Mon, 24 Feb 2014 17:52:25 -0800 (PST) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id at8si6427265vec.37.2014.02.24.17.52.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:52:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id lh14so6519250vcb.24 for ; Mon, 24 Feb 2014 17:52:25 -0800 (PST) X-Received: by 10.52.164.39 with SMTP id yn7mr12517095vdb.25.1393293145278; Mon, 24 Feb 2014 17:52:25 -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 u4csp103170vcz; Mon, 24 Feb 2014 17:52:23 -0800 (PST) X-Received: by 10.66.240.4 with SMTP id vw4mr28913742pac.26.1393293143508; Mon, 24 Feb 2014 17:52:23 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ha5si1794069pbc.270.2014.02.24.17.52.22; Mon, 24 Feb 2014 17:52:22 -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 S1753420AbaBYBwM (ORCPT + 26 others); Mon, 24 Feb 2014 20:52:12 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:47254 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752212AbaBYBwJ (ORCPT ); Mon, 24 Feb 2014 20:52:09 -0500 Received: by mail-pb0-f44.google.com with SMTP id rq2so7372893pbb.31 for ; Mon, 24 Feb 2014 17:52:09 -0800 (PST) X-Received: by 10.68.197.99 with SMTP id it3mr3189754pbc.37.1393293129155; Mon, 24 Feb 2014 17:52:09 -0800 (PST) Received: from localhost.localdomain ([116.232.61.20]) by mx.google.com with ESMTPSA id q7sm4499844pbc.20.2014.02.24.17.51.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 17:52:08 -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, mgorman@suse.de Subject: [PATCH 05/11] sched: rewrite update_cpu_load_nohz Date: Tue, 25 Feb 2014 09:50:48 +0800 Message-Id: <1393293054-11378-6-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1393293054-11378-1-git-send-email-alex.shi@linaro.org> References: <1393293054-11378-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.179 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 */