From: "Duan, Zhenzhong" <zhenzhong.duan@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"maciej.szmigiero@oracle.com" <maciej.szmigiero@oracle.com>,
"drjones@redhat.com" <drjones@redhat.com>,
"shuah@kernel.org" <shuah@kernel.org>
Subject: RE: [PATCH 0/3] Restore extra_mem_pages and add slot0_mem_pages
Date: Wed, 9 Jun 2021 05:19:53 +0000 [thread overview]
Message-ID: <DM8PR11MB5670F0CD88BE8FDB0CCA568092369@DM8PR11MB5670.namprd11.prod.outlook.com> (raw)
In-Reply-To: <356f17eb-8357-9863-6655-d1a737e587fd@redhat.com>
> -----Original Message-----
> From: Paolo Bonzini <pbonzini@redhat.com>
> Sent: Wednesday, June 9, 2021 1:30 AM
> To: Duan, Zhenzhong <zhenzhong.duan@intel.com>; linux-
> kernel@vger.kernel.org
> Cc: linux-kselftest@vger.kernel.org; kvm@vger.kernel.org;
> maciej.szmigiero@oracle.com; drjones@redhat.com; shuah@kernel.org
> Subject: Re: [PATCH 0/3] Restore extra_mem_pages and add
> slot0_mem_pages
>
> On 09/06/21 01:38, Zhenzhong Duan wrote:
> > (39fe2fc96694 "selftests: kvm: make allocation of extra memory take
> > effect") changed the meaning of extra_mem_pages and treated it as slot0
> memory size.
> >
> > In fact extra_mem_pages is used for non-slot0 memory size, there is no
> > custom
> > slot0 memory size support. See discuss in
> > https://lkml.org/lkml/2021/6/3/551
> > for more details.
> >
> > This patchset restores extra_mem_pages's original meaning and adds
> > support for custom slot0 memory with a new parameter slot0_mem_pages.
>
> Because the two reverts are so small, I squashed everything in a single patch
> with the following message:
>
> Until commit 39fe2fc96694 ("selftests: kvm: make allocation of extra
> memory take effect", 2021-05-27), parameter extra_mem_pages was used
> only to calculate the page table size for all the memory chunks,
> because real memory allocation happened with calls of
> vm_userspace_mem_region_add() after vm_create_default().
>
> Commit 39fe2fc96694 however changed the meaning of
> extra_mem_pages to
> the size of memory slot 0. This makes the memory allocation more
> flexible, but makes it harder to account for the number of
> pages needed for the page tables. For example, memslot_perf_test
> has a small amount of memory in slot 0 but a lot in other slots,
> and adding that memory twice (both in slot 0 and with later
> calls to vm_userspace_mem_region_add()) causes an error that
> was fixed in commit 000ac4295339 ("selftests: kvm: fix overlapping
> addresses in memslot_perf_test", 2021-05-29)
>
> Since both uses are sensible, add a new parameter slot0_mem_pages
> to vm_create_with_vcpus() and some comments to clarify the meaning of
> slot0_mem_pages and extra_mem_pages. With this change,
> memslot_perf_test can go back to passing the number of memory
> pages as extra_mem_pages.
>
This looks more clear, thanks for doing that.
Regards
Zhenzhong
next prev parent reply other threads:[~2021-06-09 5:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 23:38 Zhenzhong Duan
2021-06-08 16:46 ` Maciej S. Szmigiero
2021-06-08 17:30 ` Paolo Bonzini
2021-06-09 5:19 ` Duan, Zhenzhong [this message]
2021-06-08 23:38 ` [PATCH 1/3] Revert "selftests: kvm: make allocation of extra memory take effect" Zhenzhong Duan
2021-06-08 8:21 ` Andrew Jones
2021-06-08 23:38 ` [PATCH 2/3] Revert "selftests: kvm: fix overlapping addresses in memslot_perf_test" Zhenzhong Duan
2021-06-08 8:21 ` Andrew Jones
2021-06-08 23:38 ` [PATCH 3/3] selftests: kvm: Add support for customized slot0 memory size Zhenzhong Duan
2021-06-08 8:19 ` Andrew Jones
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=DM8PR11MB5670F0CD88BE8FDB0CCA568092369@DM8PR11MB5670.namprd11.prod.outlook.com \
--to=zhenzhong.duan@intel.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maciej.szmigiero@oracle.com \
--cc=pbonzini@redhat.com \
--cc=shuah@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®