From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmF6w-0008IB-TH for qemu-devel@nongnu.org; Mon, 01 Mar 2010 18:33:14 -0500 Received: from [199.232.76.173] (port=40337 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmF6w-0008Ho-IZ for qemu-devel@nongnu.org; Mon, 01 Mar 2010 18:33:14 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmF6v-0007vj-7J for qemu-devel@nongnu.org; Mon, 01 Mar 2010 18:33:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1886) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NmF6u-0007vf-RW for qemu-devel@nongnu.org; Mon, 01 Mar 2010 18:33:13 -0500 Date: Mon, 1 Mar 2010 20:32:39 -0300 From: Marcelo Tosatti Subject: Re: [Qemu-devel] [patch uq/master 2/2] Add option to use file backed guest memory 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 Content-Disposition: inline In-Reply-To: <20100301232508.GA13703@amt.cnet> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: john cooper , qemu-devel@nongnu.org, kvm@vger.kernel.org, avi@redhat.com 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.