From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751878AbaC2Oqh (ORCPT ); Sat, 29 Mar 2014 10:46:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbaC2Oqf (ORCPT ); Sat, 29 Mar 2014 10:46:35 -0400 Date: Sat, 29 Mar 2014 11:46:07 -0300 From: Marcelo Tosatti To: Zhanghailiang Cc: "johnstul@us.ibm.com" , "tglx@linutronix.de" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Zhouxiangjiu , zhang yanying Subject: Re: VDSO pvclock may increase host cpu consumption, is this a problem? Message-ID: <20140329144607.GA20316@amt.cnet> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 29, 2014 at 08:47:27AM +0000, Zhanghailiang wrote: > Hi, > I found when Guest is idle, VDSO pvclock may increase host consumption. > We can calcutate as follow, Correct me if I am wrong. > (Host)250 * update_pvclock_gtod = 1500 * gettimeofday(Guest) > In Host, VDSO pvclock introduce a notifier chain, pvclock_gtod_chain in timekeeping.c. It consume nearly 900 cycles per call. So in consideration of 250 Hz, it may consume 225,000 cycles per second, even no VM is created. > In Guest, gettimeofday consumes 220 cycles per call with VDSO pvclock. If the no-kvmclock-vsyscall is configured, gettimeofday consumes 370 cycles per call. The feature decrease 150 cycles consumption per call. > When call gettimeofday 1500 times,it decrease 225,000 cycles,equal to the host consumption. > Both Host and Guest is linux-3.13.6. > So, whether the host cpu consumption is a problem? Hi, How many percents out of the total CPU cycles are 225,000 cycles, for your CPU ?