From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
Cc: Sean Christopherson <seanjc@google.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>,
kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH RFC 0/4] KVM: x86: Drastically raise KVM_USER_MEM_SLOTS limit
Date: Thu, 28 Jan 2021 09:47:38 +0100 [thread overview]
Message-ID: <874kj130t1.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <117b94cc-d1e0-1575-e127-dd5785cf17cd@oracle.com>
"Maciej S. Szmigiero" <maciej.szmigiero@oracle.com> writes:
> Hi Vitaly,
>
> On 27.01.2021 18:55, Vitaly Kuznetsov wrote:
>> "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com> writes:
>>
>>> On 15.01.2021 14:18, Vitaly Kuznetsov wrote:
>>>> TL;DR: any particular reason why KVM_USER_MEM_SLOTS is so low?
>>>>
>>>> Longer version:
>>>>
>>>> Current KVM_USER_MEM_SLOTS limit (509) can be a limiting factor for some
>>>> configurations. In particular, when QEMU tries to start a Windows guest
>>>> with Hyper-V SynIC enabled and e.g. 256 vCPUs the limit is hit as SynIC
>>>> requires two pages per vCPU and the guest is free to pick any GFN for
>>>> each of them, this fragments memslots as QEMU wants to have a separate
>>>> memslot for each of these pages (which are supposed to act as 'overlay'
>>>> pages).
>>>>
>>>> Memory slots are allocated dynamically in KVM when added so the only real
>>>> limitation is 'id_to_index' array which is 'short'. We don't have any
>>>> KVM_MEM_SLOTS_NUM/KVM_USER_MEM_SLOTS-sized statically defined arrays.
>>>>
>>>> We could've just raised the limit to e.g. '1021' (we have 3 private
>>>> memslots on x86) and this should be enough for now as KVM_MAX_VCPUS is
>>>> '288' but AFAIK there are plans to raise this limit as well.
>>>>
>>>
>>> I have a patch series that reworks the whole memslot thing, bringing
>>> performance improvements across the board.
>>> Will post it in few days, together with a new mini benchmark set.
>>
>> I'm about to send a successor of this series. It will be implmenting
>> Sean's idea to make the maximum number of memslots a per-VM thing (and
>> also raise the default). Hope it won't interfere with your work!
>
> Thanks for your series and CC'ing me on it.
>
> It looks like there should be no design conflicts, I will merely need to
> rebase on top of it.
>
> By the way I had to change a bit the KVM selftest framework memslot
> handling for my stuff, too, since otherwise just adding 32k memslots
> for a test would take almost forever.
>
Yea, that's why PATCH5 of the new series increases the default timeout
from 45 seconds to 120.
--
Vitaly
prev parent reply other threads:[~2021-01-28 8:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 13:18 [PATCH RFC 0/4] KVM: x86: Drastically raise KVM_USER_MEM_SLOTS limit Vitaly Kuznetsov
2021-01-15 13:18 ` [PATCH RFC 1/4] KVM: x86: Drop redundant KVM_MEM_SLOTS_NUM definition Vitaly Kuznetsov
2021-01-15 16:47 ` Sean Christopherson
2021-01-15 13:18 ` [PATCH RFC 2/4] KVM: mips: Drop KVM_PRIVATE_MEM_SLOTS definition Vitaly Kuznetsov
2021-01-15 13:18 ` [PATCH RFC 3/4] KVM: Define KVM_USER_MEM_SLOTS in arch-neutral include/linux/kvm_host.h Vitaly Kuznetsov
2021-01-15 17:05 ` Sean Christopherson
2021-01-18 9:52 ` Vitaly Kuznetsov
2021-01-19 17:20 ` Sean Christopherson
2021-01-20 11:34 ` Igor Mammedov
2021-01-20 12:02 ` Vitaly Kuznetsov
2021-01-20 17:25 ` Sean Christopherson
2021-01-15 13:18 ` [PATCH RFC 4/4] KVM: x86: Stop limiting KVM_USER_MEM_SLOTS Vitaly Kuznetsov
2021-01-15 16:03 ` [PATCH RFC 0/4] KVM: x86: Drastically raise KVM_USER_MEM_SLOTS limit Sean Christopherson
2021-01-15 16:23 ` Vitaly Kuznetsov
2021-01-15 16:45 ` Sean Christopherson
2021-01-15 18:47 ` Maciej S. Szmigiero
2021-01-27 17:55 ` Vitaly Kuznetsov
2021-01-27 22:26 ` Maciej S. Szmigiero
2021-01-28 8:47 ` Vitaly Kuznetsov [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=874kj130t1.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=maciej.szmigiero@oracle.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=wanpengli@tencent.com \
/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.