From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752779AbcHMPgL (ORCPT ); Sat, 13 Aug 2016 11:36:11 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35342 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752648AbcHMPgI (ORCPT ); Sat, 13 Aug 2016 11:36:08 -0400 Date: Sat, 13 Aug 2016 17:36:04 +0200 From: Frederic Weisbecker To: Rik van Riel Cc: Wanpeng Li , Ingo Molnar , LKML , Paolo Bonzini , Peter Zijlstra , Wanpeng Li , Thomas Gleixner , Radim Krcmar , Mike Galbraith Subject: Re: [PATCH] time,virt: resync steal time when guest & host lose sync Message-ID: <20160813153601.GA21154@lerouge> References: <1468421405-20056-2-git-send-email-fweisbec@gmail.com> <1470751579.13905.77.camel@redhat.com> <20160810125212.78564dc2@annuminas.surriel.com> <1470969892.13905.120.camel@redhat.com> <20160812115803.0f26211c@annuminas.surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160812115803.0f26211c@annuminas.surriel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 12, 2016 at 11:58:03AM -0400, Rik van Riel wrote: > On Fri, 12 Aug 2016 15:09:00 +0800 > Wanpeng Li wrote: > > 2016-08-12 10:44 GMT+08:00 Rik van Riel : > > > > If you pass ULONG_MAX as the maxtime argument to > > > steal_account_process_time(), does the steal time > > > get accounted properly at 75%? > > > > Yes. > > I talked with Paolo this morning, and it turns out that if a guest > misses several timer ticks in a row, they will simply get lost. > > That means the functions calling steal_account_process_time may not > know how much CPU time has passed since the last time it was called, > but steal_account_process_time will get a good idea on how much time > the host spent running something else. > > Removing the limit, and documenting why, seems like the right way to > fix this bug. > > Wanpeng, does the patch below work for you? > > Everybody else, does this patch look acceptable? > > ---8<--- > Subject: time,virt: do not limit steal_account_process_time > > When a guest is interrupted for a longer amount of time, missed clock > ticks are not redelivered later. Because of that, we should not limit > the amount of steal time accounted to the amount of time that the > calling functions think have passed. > > Instead, simply let steal_account_process_time account however much > steal time the host told us elapsed. This can make up timer ticks > that were missed when the host scheduled somebody else. > > Signed-off-by: Rik van Riel > Reported-by: Wanpeng Li I much prefer this version. After all, even if that time spent in host is very large, it's still stolen time and we want to account it. Thanks.