From patchwork Wed Apr 16 02:43: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: 28443 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 20AEE2036D for ; Wed, 16 Apr 2014 02:46:27 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id m5sf20747276qaj.1 for ; Tue, 15 Apr 2014 19:46:26 -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=3N+SpQqfRVVxpC0+JwPOCPvh+3yh5x9YLna6r+D4+EU=; b=IPW7AEv+soLrJ+XrMuC8CW9U028EgYFU5F/KnT28PzTL9HqQ8f0UMvsh3I+/EgVmKN CUSWSOaPLEozcsX0Wih3UNz867irdtLa1UV7/DhmRdRRly89L4Kg3J4iQSaYj/YtPreJ krEOEyBGqMirgWked0nyUxMn6dSU6/nTVW6Mk3KCme+eTTZ1pH5+d39p3pQKKZAfKeN0 /ZVFKOgjVoAyFl6v3sDzrJ9kd029Fcns+acXt8WSPK0KizCCeiqbNw9lQY2UA3I/CZ0C KhBQAdcgxbg2GzskT/Q+r3hZI9s7x8zL1Qq+cuSVxdPlL8SO145a8wky0baZmP35zqxG 1stw== X-Gm-Message-State: ALoCoQnL7vscetAIZKQonWIDBMdT8O4NHh7IhpjtcTqiIPeOKHyCj1U4cWose0IHP+7fvi/238DX X-Received: by 10.236.182.230 with SMTP id o66mr2183865yhm.12.1397616386809; Tue, 15 Apr 2014 19:46:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.131 with SMTP id z3ls488453qgd.59.gmail; Tue, 15 Apr 2014 19:46:26 -0700 (PDT) X-Received: by 10.236.30.230 with SMTP id k66mr8732875yha.57.1397616386614; Tue, 15 Apr 2014 19:46:26 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id s70si21780037yhd.199.2014.04.15.19.46.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:46:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so9841400veb.4 for ; Tue, 15 Apr 2014 19:46:26 -0700 (PDT) X-Received: by 10.58.34.67 with SMTP id x3mr45382vei.37.1397616386286; Tue, 15 Apr 2014 19:46:26 -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 ib8csp277764vcb; Tue, 15 Apr 2014 19:46:25 -0700 (PDT) X-Received: by 10.68.202.194 with SMTP id kk2mr5722778pbc.156.1397616385558; Tue, 15 Apr 2014 19:46:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si11836592pbl.87.2014.04.15.19.46.24; Tue, 15 Apr 2014 19:46:24 -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 S1752714AbaDPCpb (ORCPT + 26 others); Tue, 15 Apr 2014 22:45:31 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:41732 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbaDPCom (ORCPT ); Tue, 15 Apr 2014 22:44:42 -0400 Received: by mail-pd0-f172.google.com with SMTP id p10so10161287pdj.31 for ; Tue, 15 Apr 2014 19:44:42 -0700 (PDT) X-Received: by 10.68.203.135 with SMTP id kq7mr5591377pbc.85.1397616282401; Tue, 15 Apr 2014 19:44:42 -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.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:44:41 -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 6/8] sched: rewrite update_cpu_load_nohz Date: Wed, 16 Apr 2014 10:43:27 +0800 Message-Id: <1397616209-27275-7-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.173 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 */