Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3810695pxj; Tue, 11 May 2021 12:21:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlAvEFc/WH5Icy6e1ctXIii71kQMqSfEtehisVyTsddMsJQa/cmEtkPyjr1W4mO2FafimW X-Received: by 2002:a17:906:c14c:: with SMTP id dp12mr33483937ejc.312.1620760908497; Tue, 11 May 2021 12:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620760908; cv=none; d=google.com; s=arc-20160816; b=fsVVnl7dblUU6F5EaabjxHzBoxo7stXmaQ8MyrHBp0xqNx7ns/AIJ3BN1dhexa7DOR ALomLw2dAjcqFA2H9lKsqezRNeQMAVvg/z1GPpFAAUTgQCiuRuh7LR4l2ucUWAr/aEcS VYNvwUggskht7OtcXH23EceeBpEtu33NsgeSCIiP48joGna2ohlNEws9wQ0xhwtsNnkl 9q8czM7qn/nOPCyPP5Ubxa8RVJfKQHAN0HAOT8ieTF4PCNhz6M8gwD6FsxVw5LQoKLBC qIVy6fHowdEKmj52Ql0snBlNm66EC1cDXvxA3Vj87dbF2JpzOGSrIsN36/TTUFNNrHXX SwiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ASevTwJo9RjR5FJ3MgTE2V9jTzfajAcmo8SCFELc9CM=; b=nbT51TduldVzqyXXutWFE48klfxqbB3TSkzE4v7Le2CL5vKb5Q4ERI/0typxfpSvsi kgtNTBrFvmIyP8y75yXoqWMlcYn0qgn4pc3NvAHV9e2Wx0kyXRpTkLgcFiOnaxkonTpK QFFb5Qrwl56g8W5nx8kbRlga521d8KPuloIRdHLwIDRWsBbkTETptQkPwXAObUMM5uAX Mnhg7iv+NcJP64dyqBkdDTbpLYCAtwj4eVK/sPLgt2vs2H9+06d6enlleR65kMWIk7gB GETbGwaT7ZAmnLlPaD5PGukAmJhfRoM7OIsHuAX/dnD5Nhz03+mlK5OgfjqJJCt0Fg47 q8Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GXpgHQ4w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ne11si17349050ejc.263.2021.05.11.12.21.22; Tue, 11 May 2021 12:21:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GXpgHQ4w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbhEKTT3 (ORCPT + 99 others); Tue, 11 May 2021 15:19:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36288 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbhEKTT2 (ORCPT ); Tue, 11 May 2021 15:19:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620760701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ASevTwJo9RjR5FJ3MgTE2V9jTzfajAcmo8SCFELc9CM=; b=GXpgHQ4wouo2QI01cc7SneCn1ClNhv6neDAc2UtVh9pK+YbgqMXuNw8AHkKaMrDobOQbnK GzQqPLvJVG/2o/05ng5UbRp+UNaprzHhC2hXS+vOVq+pSM3gXx2hlYnRsMYpwgVw1Fb0kn 5pqJiUbiBXPCjYaXsVjEe5HF2y2WTBs= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-309-iEyV9gotMKO50adi6LWJVg-1; Tue, 11 May 2021 15:18:19 -0400 X-MC-Unique: iEyV9gotMKO50adi6LWJVg-1 Received: by mail-ej1-f71.google.com with SMTP id z6-20020a17090665c6b02903700252d1ccso6333371ejn.10 for ; Tue, 11 May 2021 12:18:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ASevTwJo9RjR5FJ3MgTE2V9jTzfajAcmo8SCFELc9CM=; b=br8YevOE4wfGiPAdly++HSMZECfRjIfzVhG9Fdj/2OrXNIyIB0mN/ezax4SgMlOlIZ mNWSa2akSv6EsecZpAw5IoGJQu6rLGi3lDN8ChE6uUAaJi1oHK00FkPHPFkFDlffieJ3 4zA0cXs9SFmd4MGGxebGJhCSka5OTPfCBr7fFEvhAJd3PtNLiUvDmiWEMQ9XKQhD7t4e B59KRym7D1+q0uri59Np/YU3M/gRcLNhcMHMu5OCJ65Y3akkdyNXjAM7EnNx34v0P+eI eKfMDws2Myd/AaWB4cIhrMeG5hSctGuEtqoPjIXLnwJQ2825kWFzG68dRClSiUOByfaj yEeA== X-Gm-Message-State: AOAM530nrK1FVf4DrpobIRAQZUYRhflsGrjR9lq795mc5fjq8/OWIs1N xECrFZUgoHQ+KJvh1v/QJ1/0WPWGRJhalu2u+At3OGkV9nlUKWXpdGRsl5VUfh3Wj6lSp/2ZmHz AuVcpccI7wVYiavTVeEdJSZyY X-Received: by 2002:a50:f41a:: with SMTP id r26mr38166511edm.339.1620760698617; Tue, 11 May 2021 12:18:18 -0700 (PDT) X-Received: by 2002:a50:f41a:: with SMTP id r26mr38166482edm.339.1620760698379; Tue, 11 May 2021 12:18:18 -0700 (PDT) Received: from gator (cst2-174-132.cust.vodafone.cz. [31.30.174.132]) by smtp.gmail.com with ESMTPSA id h4sm13971430edv.97.2021.05.11.12.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 12:18:18 -0700 (PDT) Date: Tue, 11 May 2021 21:18:16 +0200 From: Andrew Jones To: Zhenzhong Duan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, shuah@kernel.org Subject: Re: [PATCH] selftests: kvm: make allocation of extra memory take effect Message-ID: <20210511191816.v3zoukkq7la5a4pw@gator> References: <20210512043107.30076-1-zhenzhong.duan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210512043107.30076-1-zhenzhong.duan@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 12, 2021 at 12:31:06PM +0800, Zhenzhong Duan wrote: > The extra memory pages is missed to be allocated during VM creating. > perf_test_util and kvm_page_table_test use it to alloc extra memory > currently. > > Fix it by adding extra_mem_pages to the total memory calculation before > allocate. > > Signed-off-by: Zhenzhong Duan > --- > 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 fc83f6c5902d..159f4d62241d 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -295,7 +295,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 + vcpu_pages + extra_pg_pages; > + uint64_t pages = DEFAULT_GUEST_PHY_PAGES + extra_mem_pages + vcpu_pages + extra_pg_pages; > struct kvm_vm *vm; > int i; > > -- > 2.25.1 > Reviewed-by: Andrew Jones Thanks, drew