From: David Hildenbrand <david@redhat.com>
To: Daniil Tatianin <d-tatianin@yandex-team.ru>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Weil <sw@weilnetz.de>,
Igor Mammedov <imammedo@redhat.com>,
yc-core@yandex-team.ru
Subject: Re: [PATCH v0 0/4] backends/hostmem: add an ability to specify prealloc timeout
Date: Mon, 23 Jan 2023 09:57:41 +0100 [thread overview]
Message-ID: <338cbc9a-4eea-a76c-8042-98372fb70854@redhat.com> (raw)
In-Reply-To: <20230120134749.550639-1-d-tatianin@yandex-team.ru>
On 20.01.23 14:47, Daniil Tatianin wrote:
> This series introduces new qemu_prealloc_mem_with_timeout() api,
> which allows limiting the maximum amount of time to be spent on memory
> preallocation. It also adds prealloc statistics collection that is
> exposed via an optional timeout handler.
>
> This new api is then utilized by hostmem for guest RAM preallocation
> controlled via new object properties called 'prealloc-timeout' and
> 'prealloc-timeout-fatal'.
>
> This is useful for limiting VM startup time on systems with
> unpredictable page allocation delays due to memory fragmentation or the
> backing storage. The timeout can be configured to either simply emit a
> warning and continue VM startup without having preallocated the entire
> guest RAM or just abort startup entirely if that is not acceptable for
> a specific use case.
The major use case for preallocation is memory resources that cannot be
overcommitted (hugetlb, file blocks, ...), to avoid running out of such
resources later, while the guest is already running, and crashing it.
Allocating only a fraction "because it takes too long" looks quite
useless in that (main use-case) context. We shouldn't encourage QEMU
users to play with fire in such a way. IOW, there should be no way
around "prealloc-timeout-fatal". Either preallocation succeeded and the
guest can run, or it failed, and the guest can't run.
... but then, management tools can simply start QEMU with "-S", start an
own timer, and zap QEMU if it didn't manage to come up in time, and
simply start a new QEMU instance without preallocation enabled.
The "good" thing about that approach is that it will also cover any
implicit memory preallocation, like using mlock() or VFIO, that don't
run in ordinary per-hostmem preallocation context. If setting QEMU up
takes to long, you might want to try on a different hypervisor in your
cluster instead.
I don't immediately see why we want to make our preallcoation+hostmem
implementation in QEMU more complicated for such a use case.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2023-01-23 8:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-20 13:47 [PATCH v0 0/4] backends/hostmem: add an ability to specify prealloc timeout Daniil Tatianin
2023-01-20 13:47 ` [PATCH 1/4] oslib: introduce new qemu_prealloc_mem_with_timeout() api Daniil Tatianin
2023-01-20 13:47 ` [PATCH 2/4] backends/hostmem: move memory region preallocation logic into a helper Daniil Tatianin
2023-01-20 13:47 ` [PATCH 3/4] backends/hostmem: add an ability to specify prealloc timeout Daniil Tatianin
2023-01-20 13:47 ` [PATCH 4/4] backends/hostmem: add an ability to make prealloc timeout fatal Daniil Tatianin
2023-01-23 8:57 ` David Hildenbrand [this message]
2023-01-23 13:30 ` [PATCH v0 0/4] backends/hostmem: add an ability to specify prealloc timeout Daniil Tatianin
2023-01-23 13:47 ` Daniel P. Berrangé
2023-01-23 14:10 ` David Hildenbrand
2023-01-23 14:14 ` Daniil Tatianin
2023-01-23 14:16 ` David Hildenbrand
2023-01-23 16:01 ` Daniel P. Berrangé
2023-01-24 6:57 ` Valentin Sinitsyn
2023-01-23 13:56 ` David Hildenbrand
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=338cbc9a-4eea-a76c-8042-98372fb70854@redhat.com \
--to=david@redhat.com \
--cc=d-tatianin@yandex-team.ru \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
--cc=yc-core@yandex-team.ru \
/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).