qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jitendra Kolhe <jitendra.kolhe@hpe.com>, qemu-devel@nongnu.org
Cc: ehabkost@redhat.com, imammedo@redhat.com,
	crosthwaite.peter@gmail.com, eblake@redhat.com,
	armbru@redhat.com, peter.maydell@linaro.org, kwolf@redhat.com,
	pl@kamp.de, sw@weilnetz.de, quintela@redhat.com,
	dgilbert@redhat.com, berrange@redhat.com,
	renganathan.meenakshisundaram@hpe.com,
	mohan_parthasarathy@hpe.com
Subject: Re: [Qemu-devel] [PATCH v3] mem-prealloc: reduce large guest start-up and migration time.
Date: Thu, 23 Feb 2017 11:01:59 +0100	[thread overview]
Message-ID: <a70a9dff-c42a-75dc-eb20-a9f2377f2ddd@redhat.com> (raw)
In-Reply-To: <1487843773-22344-1-git-send-email-jitendra.kolhe@hpe.com>



On 23/02/2017 10:56, Jitendra Kolhe wrote:
>      if (sigsetjmp(sigjump, 1)) {
> -        error_setg(errp, "os_mem_prealloc: Insufficient free host memory "
> -            "pages available to allocate guest RAM\n");
> +        memset_thread_failed = true;

This sigsetjmp is not needed, no one can siglongjmp to it.

The SIG_UNBLOCK/SIG_BLOCK in the main thread is not necessary, either.

>      } else {
> -        int i;
>          size_t hpagesize = qemu_fd_getpagesize(fd);
>          size_t numpages = DIV_ROUND_UP(memory, hpagesize);
>  
> -        /* MAP_POPULATE silently ignores failures */
> -        for (i = 0; i < numpages; i++) {
> -            memset(area + (hpagesize * i), 0, 1);
> -        }
> +        /* touch pages simultaneously */
> +        touch_all_pages(area, hpagesize, numpages, smp_cpus);

... and now touch_all_pages can just return memset_thread_failed, which
simplifies the code a bit.

Paolo

> +    }
> +    if (memset_thread_failed) {
> +        error_setg(errp, "os_mem_prealloc: Insufficient free host memory "
> +            "pages available to allocate guest RAM");
>      }

  reply	other threads:[~2017-02-23 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  9:56 [Qemu-devel] [PATCH v3] mem-prealloc: reduce large guest start-up and migration time Jitendra Kolhe
2017-02-23 10:01 ` Paolo Bonzini [this message]
2017-02-23 10:57   ` Jitendra Kolhe

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=a70a9dff-c42a-75dc-eb20-a9f2377f2ddd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jitendra.kolhe@hpe.com \
    --cc=kwolf@redhat.com \
    --cc=mohan_parthasarathy@hpe.com \
    --cc=peter.maydell@linaro.org \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=renganathan.meenakshisundaram@hpe.com \
    --cc=sw@weilnetz.de \
    /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 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).