From: "Jan Beulich" Subject: Re: [PATCH v3 2/3] xen/shadow: fix shadow_track_dirty_vram to work on hvm guests Date: Wed, 06 May 2015 16:41:13 +0100 Message-ID: <554A5239020000780007741F@mail.emea.novell.com> References: <1428686959-2890-1-git-send-email-roger.pau@citrix.com> <1428686959-2890-3-git-send-email-roger.pau@citrix.com> <552D22920200007800071E4B@mail.emea.novell.com> <554A2F66.2000905@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yq1Rl-0006b5-26 for xen-devel@lists.xenproject.org; Wed, 06 May 2015 15:41:17 +0000 In-Reply-To: <554A2F66.2000905@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?UTF-8?Q?Roger=20Pau=20Monn=C3=A9?= Cc: Andrew Cooper , Tim Deegan , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 06.05.15 at 17:12, wrote: > El 14/04/15 a les 14.22, Jan Beulich ha escrit: >>>>> On 10.04.15 at 19:29, wrote: >>> Modify shadow_track_dirty_vram to use a local buffer and then flush to the >>> guest without the paging_lock held. This is modeled after >>> hap_track_dirty_vram. >> >> And hence introduces the same issue: The HVMOP_track_dirty_vram >> handler explicitly allows for up to 1Gb of VRAM, yet here you >> effectively limit things to 128Mb (one page worth of bits each taking >> care of one guest page) considering heavily fragmented memory. > > Where does this limitation come from? We allocate a temporary bitmap > that has enough size to accommodate for the number of entries passed to > the function in nr. > > I guess there's some limitation I'm not seeing. You allocate a buffer via xzalloc(). When memory is heavily fragmented, the largest contiguous chunk you can expect to be able to successfully allocate is 1 page. And 1 page is worth 128Mb of tracked guest address space (4k * 8 bits each covering a 4k guest page). Jan