[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure messa
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message |
Date: |
Wed, 10 Jan 2018 15:59:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
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 <address@hidden>
>>
>> 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