From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758242AbcATIn2 (ORCPT ); Wed, 20 Jan 2016 03:43:28 -0500 Received: from www.linutronix.de ([62.245.132.108]:57189 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbcATInT (ORCPT ); Wed, 20 Jan 2016 03:43:19 -0500 Date: Wed, 20 Jan 2016 09:42:16 +0100 (CET) From: Thomas Gleixner To: Peter Zijlstra cc: Frederic Weisbecker , LKML , Byungchul Park , Chris Metcalf , Luiz Capitulino , Christoph Lameter , "Paul E . McKenney" , Mike Galbraith , Rik van Riel Subject: Re: [PATCH 1/4] sched: Don't account tickless CPU load on tick In-Reply-To: <20160119130857.GC6344@twins.programming.kicks-ass.net> Message-ID: References: <1452700891-21807-1-git-send-email-fweisbec@gmail.com> <1452700891-21807-2-git-send-email-fweisbec@gmail.com> <20160119130857.GC6344@twins.programming.kicks-ass.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Jan 2016, Peter Zijlstra wrote: > On Wed, Jan 13, 2016 at 05:01:28PM +0100, Frederic Weisbecker wrote: > > The cpu load update on tick doesn't care about dynticks and as such is > > buggy when occuring on nohz ticks (including idle ticks) as it resets > > the jiffies snapshot that was recorded on nohz entry. We eventually > > ignore the potentially long tickless load that happened before the > > tick. > > I don't get it, how can we call scheduler_tick() while > tick_nohz_tick_stopped() ? tick->nohz_stopped is merily indicating that we switched from periodic mode to tickless mode. That's probably a misnomer, but it still has that meaning. You really need to look at it from the history of that code which was designed for tickless idle. The nohz full stuff was bolted on it. So if we stop the tick in idle - or for that matter in full nohz - we look ahead when the next tick is required. That can be: - a timer wheel timer expiring - other stuff which prevents the cpu from going "tickless" like rcu, irqwork So lets assume rcu and irqwork are silent, but we have a timer expiring 100ms from now, then we program the tick timer to 100ms from now. When it fires it invokes the normal tick_sched() timer machinery: - timekeeping update - update_process_times - profile_tick I have no idea why that is a problem. If update_process_times() is invoked then it will account the elapsed time to the idle task in case of tickless idle. In case of nohz full it should simply account the time to the task which was busy on the cpu in user space. The above changelog is just crap and doesnt make any sense at all. And the patch is fixing symptoms not the root cause. Thanks, tglx