From patchwork Mon Feb 17 01:55:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 24725 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4337203BE for ; Mon, 17 Feb 2014 01:57:01 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oy12sf32397012veb.2 for ; Sun, 16 Feb 2014 17:57:00 -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=f8fO7pVBiEox8z3EgvvrfPsossljL+BKLhWplFRkJiCs6/BCVJcY61Yvx0CpPsoK6C vWKFoyLZe7ThUUIwAUGcaal9ZNNiiNshZWfV6A0oi7yngnE7tSIgHjoFYJnBNjVqlpj8 j5SzUa6F/1cXKr15x2wzgY3wlk6YhorQ8TBkSv2RDGLsZdfTD9TwzUyIdfdtOhggdk5h Ob6TjMqvgtSwtSlXJavHOsHimuhPUyJFh7aRtQSoRkbbHNUjTI5+iNxf9FeLWkdv7qJz YhAxrpo6K6SMAzU6yc4H2/T7wgdCRsaRs2FgWhR8Z0FlyvCzuXOVYYb7MSklk7J4mBVL KncQ== X-Gm-Message-State: ALoCoQmWe8ZbdRSPbyraGjoxPADzbpG3t0sModODjTT8tFi1DUps5o7cT5U68xUiuwIvnym0U614 X-Received: by 10.236.125.6 with SMTP id y6mr8271635yhh.3.1392602220475; Sun, 16 Feb 2014 17:57:00 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.18.148 with SMTP id 20ls737606qgf.89.gmail; Sun, 16 Feb 2014 17:57:00 -0800 (PST) X-Received: by 10.52.179.198 with SMTP id di6mr12799604vdc.7.1392602220352; Sun, 16 Feb 2014 17:57:00 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id c2si4171615vct.67.2014.02.16.17.57.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:57:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so11447468vcb.28 for ; Sun, 16 Feb 2014 17:57:00 -0800 (PST) X-Received: by 10.53.9.107 with SMTP id dr11mr2614508vdd.1.1392602220258; Sun, 16 Feb 2014 17:57:00 -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 u4csp102395vcz; Sun, 16 Feb 2014 17:56:59 -0800 (PST) X-Received: by 10.66.197.135 with SMTP id iu7mr406074pac.149.1392602219412; Sun, 16 Feb 2014 17:56:59 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si12816183pbj.11.2014.02.16.17.56.58; Sun, 16 Feb 2014 17:56:58 -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 S1754020AbaBQB4t (ORCPT + 27 others); Sun, 16 Feb 2014 20:56:49 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:46970 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753999AbaBQB4p (ORCPT ); Sun, 16 Feb 2014 20:56:45 -0500 Received: by mail-pa0-f42.google.com with SMTP id kl14so14755922pab.1 for ; Sun, 16 Feb 2014 17:56:45 -0800 (PST) X-Received: by 10.66.142.42 with SMTP id rt10mr23409085pab.1.1392602204944; Sun, 16 Feb 2014 17:56:44 -0800 (PST) Received: from localhost.localdomain ([116.232.92.15]) by mx.google.com with ESMTPSA id eo11sm104524083pac.0.2014.02.16.17.56.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 17:56:44 -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 v2 05/11] sched: rewrite update_cpu_load_nohz Date: Mon, 17 Feb 2014 09:55:11 +0800 Message-Id: <1392602117-20773-6-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1392602117-20773-1-git-send-email-alex.shi@linaro.org> References: <1392602117-20773-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.169 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 */