|
From: | Paul Brook |
Subject: | Re: [Qemu-devel] [PATCH QEMU] Transparent Hugepage Support #2 |
Date: | Tue, 16 Mar 2010 23:48:39 +0000 |
User-agent: | KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; ) |
> +#if defined(__linux__) && defined(__x86_64__) > +#define MAX_TRANSPARENT_HUGEPAGE_SIZE (2*1024*1024) > + if (size >= MAX_TRANSPARENT_HUGEPAGE_SIZE) I'd prefer something like: #if defined(__linux__) && defined(__x86_64__) /* [...Allow the host to use huge pages easily...]. */ #define PREFERRED_RAM_ALIGN (2*1024*1024) #endif qemu_ram_alloc(...) {... #ifdef PREFERRED_RAM_ALIGN if ((size & (PREFERRED_RAM_ALIGN - 1)) == 0) { new_block->host = qemu_memalign(...) } #endif i.e. separate the architecture specific knowledge from the generic alignment code. Paul
[Prev in Thread] | Current Thread | [Next in Thread] |