From: Tim Deegan Subject: Re: [PATCH 1 of 4] Prevent low values of max_pages for domains doing sharing or paging Date: Thu, 16 Feb 2012 16:08:27 +0000 Message-ID: <20120216160827.GE41163@ocelot.phlegethon.org> References: <11fd4e0a1e1a76ca3bc1.1329364624@xdev.gridcentric.ca> <20120216102014.GA40020@ocelot.phlegethon.org> <5612c7c996f87bb6a0e864258766e926.squirrel@webmail.lagarcavilla.org> <4F3D2F9C020000780007378E@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <4F3D2F9C020000780007378E@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: andres@gridcentric.ca, xen-devel@lists.xensource.com, andres@lagarcavilla.org, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org At 15:32 +0000 on 16 Feb (1329406348), Jan Beulich wrote: > >>> On 16.02.12 at 15:45, "Andres Lagar-Cavilla" wrote: > > But I've seen squeezed set criminally low max_pages value (i.e. 256). > > Granted, this is squeezed's problem, but shouldn't some sanity checking be > > wired into the hypervisor? Why should we even allow max_pages < tot_pages? > > The only lower boundary that the hypervisor could (perhaps should) > enforce is that of not being able to guarantee guest forward progress: > On x86, up to 2 text pages plus up to 4 data pages, times the number > of page table levels (i.e. 24 pages on 64-bit). OT: ISTR the actual number of memory accesses needed to complete one x86 instruction is much crazier than that (e.g. a memory-to-memory copy that faults on the second page of the destination, pushing most of a stack frame before hitting the SS limit and double-faulting via a task gate, &c). We did try to count it exactly for the shadow pagetables once but gave up and wildly overestimated instead, (because perf near the limit would have been too awful anyway). Tim.