From: Paolo Bonzini <pbonzini@redhat.com>
To: Bandan Das <bsd@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
kvm@vger.kernel.org, Wincy Van <fanwenyi0529@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: nVMX: Don't return error on nested bitmap memory allocation failure
Date: Wed, 29 Apr 2015 18:39:56 +0200 [thread overview]
Message-ID: <5541095C.8050305@redhat.com> (raw)
In-Reply-To: <jpg383iyl0x.fsf@redhat.com>
On 29/04/2015 18:08, Bandan Das wrote:
>>>> >> > Yeah... I hear you. Ok, let me put it this way - Assume that we can
>>>> >> > defer this allocation up until the point that the nested subsystem is
>>>> >> > actually used i.e L1 tries running a guest and we try to allocate this
>>>> >> > area. If get_free_page() failed in that case, would we still want to
>>>> >> > kill L1 too ? I guess no.
>>> >>
>>> >> We could block the hypervisor thread on the allocation, just like it
>>> >> would block on faults for swapped out pages or new ones that have to be
>>> >> reclaimed from the page cache first.
> So, block on a failure hoping that eventually it will succeed ?
>
>> > In that case we should avoid making the allocation GFP_ATOMIC to begin with.
>> >
>> > If a GFP_KERNEL allocation failed, returning -ENOMEM from KVM_RUN (which
>> > practically means killing the guest) would actually be a very real
>> > possibility.
> Sorry Paolo, I missed your point. Isn't the allocation already GFP_KERNEL ?
I mean if it were done lazily as in your thought-experiment. Then:
- a GFP_ATOMIC allocation would be bad
- a GFP_KERNEL allocation would block like Jan said; if it failed, I
would be okay with returning -ENOMEM to userspace, even if that in
practice means killing the guest.
Paolo
next prev parent reply other threads:[~2015-04-29 16:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 19:55 [PATCH] KVM: nVMX: Don't return error on nested bitmap memory allocation failure Bandan Das
2015-04-29 7:10 ` Jan Kiszka
2015-04-29 12:55 ` Bandan Das
2015-04-29 13:05 ` Jan Kiszka
2015-04-29 13:23 ` Paolo Bonzini
2015-04-29 16:08 ` Bandan Das
2015-04-29 16:39 ` Paolo Bonzini [this message]
2015-04-29 7:27 ` Nadav Amit
2015-04-29 8:17 ` Paolo Bonzini
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=5541095C.8050305@redhat.com \
--to=pbonzini@redhat.com \
--cc=bsd@redhat.com \
--cc=fanwenyi0529@gmail.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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.