From: Ingo Molnar Subject: Re: [PATCH 1/2] kvm tools: Add memory gap for larger RAM sizes Date: Wed, 11 May 2011 09:10:43 +0200 Message-ID: <20110511071043.GG22551@elte.hu> References: <1305061513-28360-1-git-send-email-levinsasha928@gmail.com> <1305094876.2249.2.camel@sasha> <4DCA2C00.9090907@cs.helsinki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sasha Levin , asias.hejun@gmail.com, prasadjoshi124@gmail.com, avi@redhat.com, gorcunov@gmail.com, kvm@vger.kernel.org To: Pekka Enberg Return-path: Received: from fallback.mail.elte.hu ([157.181.151.13]:45570 "EHLO fallback.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752597Ab1EKQdE (ORCPT ); Wed, 11 May 2011 12:33:04 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]) by fallback.mail.elte.hu with esmtp (Exim) id 1QK3ia-0004ib-DW from for ; Wed, 11 May 2011 09:20:24 +0200 Content-Disposition: inline In-Reply-To: <4DCA2C00.9090907@cs.helsinki.fi> Sender: kvm-owner@vger.kernel.org List-ID: * Pekka Enberg wrote: > On 5/11/11 9:21 AM, Sasha Levin wrote: > >If you feel the 512MB vs guest_flat_to_host() trade-off is worth it, > >I'll change it to work that way. > > Why would it not be? This is 64-bit only, right? There's plenty of virtual > address space and mprotect() should make sure we never allocate physical > pages for it. Sure, there's some in-kernel overhead involved as well, but > that's extremely small. > > I'm not worried about performance in guest_flat_to_host() but I think the > current implementation is not very clean. If you want to mmap() two separate > regions, we should have our own internal "memory map" that's used for this > (and for populating KVM end E820 maps). > > So I think mmap'ing the gap is the cleanest solution for now. We can revisit > the decision if we need even more regions in the future. Agreed. There's also admittedly somewhat of a conceptual beauty in having a linearly addressable chunk of *all* guest physical RAM on the hypervisor side. Virtualization involves so many indirections to begin with that keeping the mental picture simpler is helpful IMHO ... Thanks, Ingo