From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 4 of 4] xenpaging: initial libxl support Date: Tue, 22 Nov 2011 12:22:48 +0100 Message-ID: <20111122112248.GA28172@aepfle.de> References: <20111107125535.GA16522@aepfle.de> <20111120182951.GA4830@aepfle.de> <20111121151359.GA22981@aepfle.de> 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.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: George Dunlap , "xen-devel@lists.xensource.com" , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Tue, Nov 22, Stefano Stabellini wrote: > On Mon, 21 Nov 2011, Olaf Hering wrote: > > On Mon, Nov 21, Stefano Stabellini wrote: > > > > > what if tot_memkb is bigger than target_memkb? Or even bigger than > > > max_memkb? > > > > tot_memkb is unrelated to target_memkb, also somewhat unrelated to > > max_memkb. > > At build time ballooning is not active yet and target_memkb represents > the amount of memory available to the VM plus the videoram (see > libxl__build_hvm). > As a consequence I think that tot_memkb cannot be higher than > target_memkb - videoram_memkb (that is build_start in the diagram). It can because with xenpaging the target_memkb turns from real memory into virtual memory, and tot_memkb is the new amount of real memory. The actual checking wether the tot_memkb/target_memkb/max_memkb are sane can be either done when they are changed with xl mem-XY like its done now. Or we add new code to do such checking already during config parsing. > So, what is going to happen if tot_memkb is higher than target_memkb - > videoram_memkb? Nothing happens, since xenpaging is the only consumer of that variable (via xenstore). See below. > Also, what is going to happen if it is lower? If its lower, xenpaging will page-out some pages, adds them back if the guest happens to access them and page-out some other pages. The guest still has access to all memory it thinks it has (target_memkb). > > xenpaging will look at tot_memkb value (at "memory/target-tot_pages" to > > be precise) and try to reach that number of domain->tot_pages. If the > > tot_memkb number is larger than max_memkb nothing will happen. > > How is it going to reach the tot_pages target? Where is it going to take > the memory from? Is it going to automatically page out memory from other > VMs? xenpaging does not add new memory. If it has no pages to page-in and tot_pages is still higher, it will do nothing. > > Right now there is not much checking anyway, memory=1024 maxmem=1 in the > > config is accepted in my testing. > > That is a correct configuration: it means that the domain has 1024MB of > RAM but it cannot allocate any more (maximum allocation limit being 1MB). > maxmem doesn't influence the current memory of the VM, only future > allocations. It causes stall in the host, perhaps due to an interger overflow (I have not analyzed it yet). Olaf