From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932735AbcFBMAc (ORCPT ); Thu, 2 Jun 2016 08:00:32 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50837 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932294AbcFBMAa (ORCPT ); Thu, 2 Jun 2016 08:00:30 -0400 Date: Thu, 2 Jun 2016 14:00:23 +0200 From: Peter Zijlstra To: Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Wanpeng Li , Ingo Molnar , Rik van Riel , Thomas Gleixner , Frederic Weisbecker , Paolo Bonzini , Radim Subject: Re: [PATCH] sched/cputime: add steal clock warps handling during cpu hotplug Message-ID: <20160602120023.GC3190@twins.programming.kicks-ass.net> References: <1464868639-8924-1-git-send-email-wanpeng.li@hotmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464868639-8924-1-git-send-email-wanpeng.li@hotmail.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 Thu, Jun 02, 2016 at 07:57:19PM +0800, Wanpeng Li wrote: > From: Wanpeng Li > > I observed that sometimes st is 100% instantaneous, then idle is 100% > even if there is a cpu hog on the guest cpu after the cpu hotplug comes > back(N.B. both guest and host are latest 4.7-rc1, this can not always > be readily reproduced). I add trace to capture it as below: > > cpuhp/1-12 [001] d.h1 167.461657: account_process_tick: steal = 1291385514, prev_steal_time = 0 > cpuhp/1-12 [001] d.h1 167.461659: account_process_tick: steal_jiffies = 1291 > -0 [001] d.h1 167.462663: account_process_tick: steal = 18732255, prev_steal_time = 1291000000 > -0 [001] d.h1 167.462664: account_process_tick: steal_jiffies = 18446744072437 > > The steal clock warps and then steal_jiffies overflow, this patch align > prev_steal_time to the new steal clock timestamp, in order to avoid > overflow and st stuff can continue to work. I would rather suggest fixing the steal clock thing to not jump like that; is that at all possible?