From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [Qemu-devel] [patch uq/master 2/2] Add option to use file backed guest memory Date: Mon, 1 Mar 2010 20:32:39 -0300 Message-ID: <20100301233239.GA21535@amt.cnet> References: <20100224211117.958583246@amt.cnet> <20100224211507.913712224@amt.cnet> <201002280128.16649.paul@codesourcery.com> <20100301232508.GA13703@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, john cooper , avi@redhat.com To: Paul Brook Return-path: Received: from mx1.redhat.com ([209.132.183.28]:63505 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263Ab0CAXdN (ORCPT ); Mon, 1 Mar 2010 18:33:13 -0500 Content-Disposition: inline In-Reply-To: <20100301232508.GA13703@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Mar 01, 2010 at 08:25:08PM -0300, Marcelo Tosatti wrote: > Hi Paul, > > Thank you for reviewing. > > On Sun, Feb 28, 2010 at 01:28:16AM +0000, Paul Brook wrote: > > IMHO it would be better to check the mem_path != NULL here, rather that > > burying the check in file_ram_alloc. > > > > >+ if (memory < hpagesize) { > > >+ return NULL; > > >+ } > > > > Ah, so it's actually "allocate memory in $path, if you feel like it". Good job > > we aren't relying on this for correctness. At minimum I recommend documenting > > this heuristic. > > More like "allocate memory in $path, if it its larger than a hugepage." > > Huge pages are an optimization. > > > > > >+ if (!new_block->host) { > > > #if defined(TARGET_S390X) && defined(CONFIG_KVM) > > >- /* XXX S390 KVM requires the topmost vma of the RAM to be < 256GB */ > > > > By my reading this implies -mempath is probably broken on s390 KVM? > > > > >+DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath, > > >+ "-mem-path FILE provide backing storage for guest RAM\n") > > >+STEXI > > >+@item -mem-path @var{path} > > >+Allocate guest RAM from a temporarily created file in @var{path}. > > >+ETEXI > > > > You should mention that this is only useful when PATH happens to be a linux > > hugetlbfs mount. > > It can be used with a file, since its mapped as MAP_PRIVATE. I meant non hugetlbfs backed file.