From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [RFC PATCH 0/2] Expose available KVM free memory slot count to help avoid aborts Date: Thu, 24 Feb 2011 11:10:25 -0700 Message-ID: <1298571025.6140.36.camel@x201> References: <20110121233040.22262.68117.stgit@s20.home> <20110124093241.GA28654@amt.cnet> <4D3D89B1.30300@siemens.com> <1295883899.3230.9.camel@x201> <1295933876.3230.46.camel@x201> <20110131191834.GA27154@amt.cnet> <1298497605.18387.70.camel@x201> <4D66506A.3030203@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Jan Kiszka , "kvm@vger.kernel.org" , "ddutile@redhat.com" , "mst@redhat.com" , "chrisw@redhat.com" To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:64399 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754667Ab1BXSK3 (ORCPT ); Thu, 24 Feb 2011 13:10:29 -0500 In-Reply-To: <4D66506A.3030203@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2011-02-24 at 14:34 +0200, Avi Kivity wrote: > On 02/23/2011 11:46 PM, Alex Williamson wrote: > > > > > > But kvm_arch_flush_shadow() takes mmu_lock currently, so that needs > > > fixing. > > > > Hmm, I tried to follow the example in the !npages path just above this > > that does: > > > > rcu_assign_pointer() > > synchronize_srcu_expedited() > > kvm_arch_flush_shadow() > > > > Do we have an existing issue there with mmu_lock? Thanks, > > > > It's the issue I pointed out - after rcu_assign_pointer and before > kvm_arch_flush_shadow() we can still get shadow pages created, so we > have a mix of direct and indirect bitmap. Either my solution (recording > whether the bitmap is direct or not in kvm_mmu_page) or Marcelo's > (preventing shadow instantiation during this period) should work. Thanks, I understand better now. Alex