qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] preallocate memory after NUMA policy configurat


From: Hu Tao
Subject: Re: [Qemu-devel] [PATCH] preallocate memory after NUMA policy configuration
Date: Fri, 9 May 2014 14:42:45 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 09, 2014 at 03:24:52AM -0300, Marcelo Tosatti wrote:
> 
> (note: applies on top of patchset of current thread)
> 
> Preallocate memory after the NUMA policy has been instantiated.
> This is necessary to guarantee memory is allocated with 
> specified NUMA policy in place.
> 
> Signed-off-by: Marcelo Tosatti <address@hidden>
> 
> diff --git a/backends/hostmem.c b/backends/hostmem.c
> index d3f8476..3cfa8a0 100644
> --- a/backends/hostmem.c
> +++ b/backends/hostmem.c
> @@ -293,9 +293,6 @@ host_memory_backend_memory_init(UserCreatable *uc, Error 
> **errp)
>      if (!backend->dump) {
>          qemu_madvise(ptr, sz, QEMU_MADV_DONTDUMP);
>      }
> -    if (backend->prealloc) {
> -        os_mem_prealloc(memory_region_get_fd(&backend->mr), ptr, sz);
> -    }
>  
>  #ifdef CONFIG_NUMA
>      unsigned long maxnode = find_last_bit(backend->host_nodes, MAX_NODES);
> @@ -310,6 +307,9 @@ host_memory_backend_memory_init(UserCreatable *uc, Error 
> **errp)
>          return;
>      }
>  #endif
> +    if (backend->prealloc) {
> +        os_mem_prealloc(memory_region_get_fd(&backend->mr), ptr, sz);
> +    }
>  }
>  
>  MemoryRegion *

Thanks, I'll squash it in patch 25.

Regards,
Hu Tao



reply via email to

[Prev in Thread] Current Thread [Next in Thread]