From: Wei Liu Subject: Re: Balloon driver bug in increase_reservation Date: Wed, 4 Sep 2013 17:30:56 +0100 Message-ID: <20130904163056.GU14104@zion.uk.xensource.com> References: <20130902144333.GA14104@zion.uk.xensource.com> <1378133323.7651.39.camel@kazak.uk.xensource.com> <20130902150432.GB14104@zion.uk.xensource.com> <1378134566.7651.40.camel@kazak.uk.xensource.com> <20130902151328.GC14104@zion.uk.xensource.com> <1378135882.7651.46.camel@kazak.uk.xensource.com> <20130904132010.GP14104@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xen.org, Wei Liu , Ian Campbell , david.vrabel@citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, Sep 04, 2013 at 02:31:13PM +0100, Stefano Stabellini wrote: [...] > > > > > > - if the guest is autotranslate, then the BUG_ON is already irrelevant; > > > - if the guest is not autotranslate, then we are sure that the p2m of > > > the page is pointing to a scratch page; > > > > > > either way the BUG_ON is wrong. > > > > Is it there to guard other misuse of the function? IOW can we be > > confident that all calls are legit? > > the ballooned_pages list would need to be broken for this BUG_ON to > trigger > Right. > > > Messing up the P2M table looks very hard to debug? > > > > > Otherwise could simply implement a is_balloon_scratch_page function that > > > checks whether a given pfn corresponds to any of the scratch pages (it > > > doesn't need to be the scratch page of this cpu). > > > > That's quite expensive IMHO, especially when you have lots of CPU's and > > lots of ballooned pages. > > as a compromise we could run a check on the pfn only on debug runs? Actually I'm out of idea now so I'm happy to implement a solution that everybody agrees... Wei.