Message ID | 20180109193745.GA18506@amt.cnet |
---|---|
State | New |
Headers | show |
Series | qemu: improve hugepage allocation failure message | expand |
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; > } > > >
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
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
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; }
Improve hugepage allocation failure message, indicating whats happening to the user. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>