qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message
@ 2018-01-09 19:37 Marcelo Tosatti
  2018-01-09 19:41 ` Eric Blake
  2018-01-09 20:16 ` Haozhong Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2018-01-09 19:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini


Improve hugepage allocation failure message, indicating
whats happening to the user.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/exec.c b/exec.c
index 4722e521d4..439abedb98 100644
--- a/exec.c
+++ b/exec.c
@@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block,
                          block->flags & RAM_SHARED);
     if (area == MAP_FAILED) {
         error_setg_errno(errp, errno,
-                         "unable to map backing store for guest RAM");
+                         "unable to map backing store for guest RAM, "
+                         "falling back to malloc based RAM allocation");
         return NULL;
     }
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message
  2018-01-09 19:37 [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message Marcelo Tosatti
@ 2018-01-09 19:41 ` Eric Blake
  2018-01-09 20:16 ` Haozhong Zhang
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2018-01-09 19:41 UTC (permalink / raw)
  To: Marcelo Tosatti, qemu-devel; +Cc: Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

On 01/09/2018 01:37 PM, Marcelo Tosatti wrote:
> 
> Improve hugepage allocation failure message, indicating
> whats happening to the user.

s/whats/what's/

> 
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> 
> diff --git a/exec.c b/exec.c
> index 4722e521d4..439abedb98 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block,
>                           block->flags & RAM_SHARED);
>      if (area == MAP_FAILED) {
>          error_setg_errno(errp, errno,
> -                         "unable to map backing store for guest RAM");
> +                         "unable to map backing store for guest RAM, "
> +                         "falling back to malloc based RAM allocation");
>          return NULL;
>      }
>  
> 
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message
  2018-01-09 19:37 [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message Marcelo Tosatti
  2018-01-09 19:41 ` Eric Blake
@ 2018-01-09 20:16 ` Haozhong Zhang
  2018-01-10 14:59   ` Paolo Bonzini
  1 sibling, 1 reply; 4+ messages in thread
From: Haozhong Zhang @ 2018-01-09 20:16 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: qemu-devel, Paolo Bonzini

On 01/09/18 17:37 -0200, Marcelo Tosatti wrote:
> 
> Improve hugepage allocation failure message, indicating
> whats happening to the user.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> 
> diff --git a/exec.c b/exec.c
> index 4722e521d4..439abedb98 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block,
>                           block->flags & RAM_SHARED);
>      if (area == MAP_FAILED) {
>          error_setg_errno(errp, errno,
> -                         "unable to map backing store for guest RAM");
> +                         "unable to map backing store for guest RAM, "
> +                         "falling back to malloc based RAM allocation");
>          return NULL;
>      }
>  

The backing store here is not always hugetlbfs, e.g., it can be NVDIMM
and even regular files. In those cases, the failure of file_ram_alloc()
does not fall back to malloc.

Haozhong

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message
  2018-01-09 20:16 ` Haozhong Zhang
@ 2018-01-10 14:59   ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2018-01-10 14:59 UTC (permalink / raw)
  To: Marcelo Tosatti, qemu-devel

On 09/01/2018 21:16, Haozhong Zhang wrote:
> On 01/09/18 17:37 -0200, Marcelo Tosatti wrote:
>>
>> Improve hugepage allocation failure message, indicating
>> whats happening to the user.
>>
>> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>>
>> diff --git a/exec.c b/exec.c
>> index 4722e521d4..439abedb98 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -1643,7 +1643,8 @@ static void *file_ram_alloc(RAMBlock *block,
>>                           block->flags & RAM_SHARED);
>>      if (area == MAP_FAILED) {
>>          error_setg_errno(errp, errno,
>> -                         "unable to map backing store for guest RAM");
>> +                         "unable to map backing store for guest RAM, "
>> +                         "falling back to malloc based RAM allocation");
>>          return NULL;
>>      }
>>  
> 
> The backing store here is not always hugetlbfs, e.g., it can be NVDIMM
> and even regular files. In those cases, the failure of file_ram_alloc()
> does not fall back to malloc.

It's also not happending if !mem_prealloc.  Let's instead add an
error_report in allocate_system_memory_nonnuma (and it's probably better
to use MAP_ANON instead of malloc in the message).

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-10 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-09 19:37 [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message Marcelo Tosatti
2018-01-09 19:41 ` Eric Blake
2018-01-09 20:16 ` Haozhong Zhang
2018-01-10 14:59   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).