From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NplIu-0003d1-TX for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:32:09 -0500 Received: from [199.232.76.173] (port=41587 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NplIt-0003c6-Ei for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:32:07 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NplIn-0001XF-QR for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:32:06 -0500 Received: from mx20.gnu.org ([199.232.41.8]:39512) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NplIm-0001MS-Af for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:32:01 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NplF8-00075z-EE for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:28:14 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH QEMU] transparent hugepage support Date: Thu, 11 Mar 2010 16:28:04 +0000 References: <20100311151427.GE5677@random.random> <4B9911B0.5000302@redhat.com> In-Reply-To: <4B9911B0.5000302@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003111628.04566.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andrea Arcangeli , Avi Kivity > > + /* > > + * Align on HPAGE_SIZE so "(gfn ^ pfn)& > > + * (HPAGE_SIZE-1) == 0" to allow KVM to take advantage > > + * of hugepages with NPT/EPT. > > + */ > > + new_block->host = qemu_memalign(1<< TARGET_HPAGE_BITS, size); This should not be target dependent. i.e. it should be the host page size. > That is a little wasteful. How about a hint to mmap() requesting proper > alignment (MAP_HPAGE_ALIGN)? I'd kinda hope that we wouldn't need to. i.e. the host kernel is smart enough to automatically align large allocations anyway. This is probably a useful optimization regardless of KVM. Paul