kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Zhenzhong Duan <zhenzhong.duan@intel.com>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	kvm@vger.kernel.org, maciej.szmigiero@oracle.com,
	pbonzini@redhat.com, shuah@kernel.org
Subject: Re: [PATCH 1/3] Revert "selftests: kvm: make allocation of extra memory take effect"
Date: Tue, 8 Jun 2021 10:21:42 +0200	[thread overview]
Message-ID: <20210608082142.umk5jauizkxxs4yb@gator> (raw)
In-Reply-To: <20210608233816.423958-2-zhenzhong.duan@intel.com>

On Wed, Jun 09, 2021 at 07:38:14AM +0800, Zhenzhong Duan wrote:
> This reverts commit 39fe2fc96694164723846fccf6caa42c3aee6ec4.
> 
> Parameter extra_mem_pages in vm_create_default() is used to calculate
> the page table size for all the memory chunks.
> Real memory allocation for non-slot0 memory happens by extra call of
> vm_userspace_mem_region_add() outside of vm_create_default().
> 
> The reverted commit changed above meaning of extra_mem_pages as extra
> slot0 memory size. This way made the page table size calculations
> open coded in separate test.
> 
> Link: https://lkml.org/lkml/2021/6/3/551
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>  tools/testing/selftests/kvm/lib/kvm_util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
> index 28e528c19d28..63418df921f0 100644
> --- a/tools/testing/selftests/kvm/lib/kvm_util.c
> +++ b/tools/testing/selftests/kvm/lib/kvm_util.c
> @@ -320,7 +320,7 @@ struct kvm_vm *vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus,
>  	 */
>  	uint64_t vcpu_pages = (DEFAULT_STACK_PGS + num_percpu_pages) * nr_vcpus;
>  	uint64_t extra_pg_pages = (extra_mem_pages + vcpu_pages) / PTES_PER_MIN_PAGE * 2;
> -	uint64_t pages = DEFAULT_GUEST_PHY_PAGES + extra_mem_pages + vcpu_pages + extra_pg_pages;
> +	uint64_t pages = DEFAULT_GUEST_PHY_PAGES + vcpu_pages + extra_pg_pages;
>  	struct kvm_vm *vm;
>  	int i;
>  
> -- 
> 2.25.1
>

Reviewed-by: Andrew Jones <drjones@redhat.com>


  reply	other threads:[~2021-06-08  8:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 23:38 [PATCH 0/3] Restore extra_mem_pages and add slot0_mem_pages Zhenzhong Duan
2021-06-08 16:46 ` Maciej S. Szmigiero
2021-06-08 17:30 ` Paolo Bonzini
2021-06-09  5:19   ` Duan, Zhenzhong
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 [this message]
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=20210608082142.umk5jauizkxxs4yb@gator \
    --to=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 \
    --cc=zhenzhong.duan@intel.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 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).