From: Paolo Bonzini <pbonzini@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>, imammedo@redhat.com
Cc: armbru@redhat.com, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] memory: exit when hugepage allocation fails if mem-prealloc
Date: Tue, 26 Jan 2016 11:40:26 +0100 [thread overview]
Message-ID: <56A74D1A.1070909@redhat.com> (raw)
In-Reply-To: <20160122091501.75bbd42a@redhat.com>
On 22/01/2016 15:15, Luiz Capitulino wrote:
> When -mem-prealloc is passed on the command-line, the expected
> behavior is to exit if the hugepage allocation fails. However,
> this behavior is broken since commit cc57501dee which made
> hugepage allocation fall back to regular ram in case of faliure.
>
> This commit restores the expected behavior for -mem-prealloc.
>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
> numa.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/numa.c b/numa.c
> index 425ef8d..0e1638d 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -418,12 +418,13 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
> Error *err = NULL;
> memory_region_init_ram_from_file(mr, owner, name, ram_size, false,
> mem_path, &err);
> -
> - /* Legacy behavior: if allocation failed, fall back to
> - * regular RAM allocation.
> - */
> if (err) {
> error_report_err(err);
> + if (mem_prealloc)
> + exit(1);
> + /* Legacy behavior: if allocation failed, fall back to
> + * regular RAM allocation.
> + */
> memory_region_init_ram(mr, owner, name, ram_size, &error_fatal);
> }
> #else
>
Right, patch cc57501dee did the correct change but it was insufficient.
I'll add the braces for you and queue the patch.
Paolo
prev parent reply other threads:[~2016-01-26 10:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-22 14:15 [Qemu-devel] [PATCH] memory: exit when hugepage allocation fails if mem-prealloc Luiz Capitulino
2016-01-26 10:40 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56A74D1A.1070909@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=imammedo@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.