From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759987AbbKTNUB (ORCPT ); Fri, 20 Nov 2015 08:20:01 -0500 Received: from casper.infradead.org ([85.118.1.10]:33319 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbbKTNT7 (ORCPT ); Fri, 20 Nov 2015 08:19:59 -0500 Date: Fri, 20 Nov 2015 14:19:55 +0100 From: Peter Zijlstra To: byungchul.park@lge.com Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, efault@gmx.de, tglx@linutronix.de, fweisbec@gmail.com Subject: Re: [PATCH v5 2/2] sched: make update_cpu_load_nohz() consider missed ticks in NOHZ_FULL Message-ID: <20151120131955.GE17308@twins.programming.kicks-ass.net> References: <1447115762-19734-1-git-send-email-byungchul.park@lge.com> <1447115762-19734-3-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447115762-19734-3-git-send-email-byungchul.park@lge.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2015 at 09:36:02AM +0900, byungchul.park@lge.com wrote: > +++ b/kernel/sched/fair.c > @@ -4419,10 +4419,11 @@ static void update_idle_cpu_load(struct rq *this_rq) > /* > * Called from tick_nohz_idle_exit() -- try and fix up the ticks we missed. > */ > -void update_cpu_load_nohz(void) > +void update_cpu_load_nohz(int active) > { > struct rq *this_rq = this_rq(); > unsigned long curr_jiffies = READ_ONCE(jiffies); > + unsigned long load = active ? weighted_cpuload(cpu_of(this_rq)) : 0; > unsigned long pending_updates; > > if (curr_jiffies == this_rq->last_load_update_tick) > @@ -4433,10 +4434,11 @@ void update_cpu_load_nohz(void) > 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. > + * In the regular NOHZ case, we were idle, this means load 0. > + * In the NOHZ_FULL case, we were non-idle, we should consider > + * its weighted load. > */ > - __update_cpu_load(this_rq, 0, pending_updates, 0); > + __update_cpu_load(this_rq, load, pending_updates, active); > } > raw_spin_unlock(&this_rq->lock); > } Bah, so I did all the work to get the actual number of lost ticks in there, only to _then_ find out that's mostly pointless :-) The problem is update_idle_cpu_load() is called while idle (from another CPU), so it still needs the whole jiffy based thing. So I'll take this patch for now. Thanks.