From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] use slots_lock to protect writes to the wall clock Date: Tue, 18 Mar 2008 11:52:20 +0200 Message-ID: <47DF90D4.7090801@qumranet.com> References: <1205784615-23255-1-git-send-email-gcosta@redhat.com> <47DF643F.5000707@qumranet.com> <47DF8F5B.9080606@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti To: Glauber Costa Return-path: In-Reply-To: <47DF8F5B.9080606@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Glauber Costa wrote: >> >> This lock is fairly annoying. What do you think about taking it in >> vcpu_run unconditionally and only dropping it while in guest mode? >> Most exits are mmu (or with npt, mmio) so they need to take it anyway. >> > Can't see the point. This is taken before updates to the wall clock, > not system time. I mean in general, not related to wall clock. > [avi@firebolt linux-2.6 (master)]$ git grep down_read.*slots_lock > arch/x86/kvm/ | wc -l > 16 We take the lock for read 16 times, could be narrowed down to probably once (with a drop and re-take around guest mode). -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/