Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp136217imj; Wed, 13 Feb 2019 06:01:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IbxLF/69rcqfy33U+9XAnFsdlthP6aM1RFzd70Cxl/kCZSmx4tiPxIQ9k2UvasFkVv6iVMl X-Received: by 2002:a63:ed42:: with SMTP id m2mr597365pgk.147.1550066473036; Wed, 13 Feb 2019 06:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550066473; cv=none; d=google.com; s=arc-20160816; b=OsH4y/fjA3JKSQbL3dcZjOC0TNahhVUkPY5OkSwIfzAgx9X/Yi7Z83/OPwjKSAYDoc L3HP5rko5UjNOmvppVa09UvfpxLd8D4sXuRuR187dIcEbCTeZqK4COmD4D3YTmylUYd3 CQgTAMT9n0Odo/ieqhTO9dMhThRPdA9unQGkzjze5QQowfQMtRI07Q2AoJc2S016FJnH v3H3foxwll7mkkk4BiBBpWgtQXtO64HAYzRM4aaK+hq2gQFZWbqxf4jbtrGMQqi4wQK+ quzSl+U6ZZrR78MFSeuW0c28JKmZBe6J7pHR7Xg7DmZIb/eXKmlI4kCRaGnsDl0rfqco Zyfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:to :subject; bh=+Xx1ad70s/XpwJukV1R5Cfz0i/sFdFHINO6a2yRiD6Q=; b=tohD7LMPbWyJql07Y8dPmi6A9lwr7Nv5y7IfirjPHwrKLUJLwgA6T8Fm1Y0/RIqwRG oKxA83qPyMMn+yAknF3DdkT3n4YFzgFOEnHUTZKWTKrkbwGeC1IgfEeGg5ZSUoBXwITi euuVnFKlOEzpgPKRWAt0+Qmic45kQK8titV0DOPW3m/h2a9KuCbg8BHhn7vDAytiiFGq XNZSTKux2ajzylYf3g7fdBY8lhPvurhe+VkPjwBjw3/fku7RLlh/w+BFy3kiLcb3Gafo STBuZI/yKoKv/PvKHbSwVnfqdnrx/oxzOmgp9gp9fEGyYrO1kOIRpep665ekRtDuEA8N BuDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si7527753pgv.438.2019.02.13.06.00.54; Wed, 13 Feb 2019 06:01:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388919AbfBMMG4 (ORCPT + 99 others); Wed, 13 Feb 2019 07:06:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54130 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbfBMMG4 (ORCPT ); Wed, 13 Feb 2019 07:06:56 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 648AC420A6; Wed, 13 Feb 2019 12:06:54 +0000 (UTC) Received: from [10.40.205.148] (unknown [10.40.205.148]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E64B05C226; Wed, 13 Feb 2019 12:06:36 +0000 (UTC) Subject: Re: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting To: "Wang, Wei W" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "pbonzini@redhat.com" , "lcapitulino@redhat.com" , "pagupta@redhat.com" , "yang.zhang.wz@gmail.com" , "riel@surriel.com" , "david@redhat.com" , "mst@redhat.com" , "dodgen@google.com" , "konrad.wilk@oracle.com" , "dhildenb@redhat.com" , "aarcange@redhat.com" References: <20190204201854.2328-1-nitesh@redhat.com> <286AC319A985734F985F78AFA26841F73DF6B56A@shsmsx102.ccr.corp.intel.com> From: Nitesh Narayan Lal Openpgp: preference=signencrypt Autocrypt: addr=nitesh@redhat.com; prefer-encrypt=mutual; keydata= mQINBFl4pQoBEADT/nXR2JOfsCjDgYmE2qonSGjkM1g8S6p9UWD+bf7YEAYYYzZsLtbilFTe z4nL4AV6VJmC7dBIlTi3Mj2eymD/2dkKP6UXlliWkq67feVg1KG+4UIp89lFW7v5Y8Muw3Fm uQbFvxyhN8n3tmhRe+ScWsndSBDxYOZgkbCSIfNPdZrHcnOLfA7xMJZeRCjqUpwhIjxQdFA7 n0s0KZ2cHIsemtBM8b2WXSQG9CjqAJHVkDhrBWKThDRF7k80oiJdEQlTEiVhaEDURXq+2XmG jpCnvRQDb28EJSsQlNEAzwzHMeplddfB0vCg9fRk/kOBMDBtGsTvNT9OYUZD+7jaf0gvBvBB lbKmmMMX7uJB+ejY7bnw6ePNrVPErWyfHzR5WYrIFUtgoR3LigKnw5apzc7UIV9G8uiIcZEn C+QJCK43jgnkPcSmwVPztcrkbC84g1K5v2Dxh9amXKLBA1/i+CAY8JWMTepsFohIFMXNLj+B RJoOcR4HGYXZ6CAJa3Glu3mCmYqHTOKwezJTAvmsCLd3W7WxOGF8BbBjVaPjcZfavOvkin0u DaFvhAmrzN6lL0msY17JCZo046z8oAqkyvEflFbC0S1R/POzehKrzQ1RFRD3/YzzlhmIowkM BpTqNBeHEzQAlIhQuyu1ugmQtfsYYq6FPmWMRfFPes/4JUU/PQARAQABtCVOaXRlc2ggTmFy YXlhbiBMYWwgPG5pbGFsQHJlZGhh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XTR+GSVq87Xfuhx0LRST NK9ZhT0+qkiN7npFLtNtbzwqaqceq3XhafmCiw8xrtzCnlB/C4SiBr/93Ip4kihXJ0EuHSLn VujM7c/b4pps Organization: Red Hat Inc, Message-ID: Date: Wed, 13 Feb 2019 07:06:32 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <286AC319A985734F985F78AFA26841F73DF6B56A@shsmsx102.ccr.corp.intel.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wJpfxsrk2Gr0YRZLQdbt08sQsMIednBHY" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 13 Feb 2019 12:06:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wJpfxsrk2Gr0YRZLQdbt08sQsMIednBHY Content-Type: multipart/mixed; boundary="PLnnUTd4vEqoEphvcp8R9SJ7Y1kub4KsV"; protected-headers="v1" From: Nitesh Narayan Lal To: "Wang, Wei W" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "pbonzini@redhat.com" , "lcapitulino@redhat.com" , "pagupta@redhat.com" , "yang.zhang.wz@gmail.com" , "riel@surriel.com" , "david@redhat.com" , "mst@redhat.com" , "dodgen@google.com" , "konrad.wilk@oracle.com" , "dhildenb@redhat.com" , "aarcange@redhat.com" Message-ID: Subject: Re: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting References: <20190204201854.2328-1-nitesh@redhat.com> <286AC319A985734F985F78AFA26841F73DF6B56A@shsmsx102.ccr.corp.intel.com> In-Reply-To: <286AC319A985734F985F78AFA26841F73DF6B56A@shsmsx102.ccr.corp.intel.com> --PLnnUTd4vEqoEphvcp8R9SJ7Y1kub4KsV Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US On 2/13/19 4:00 AM, Wang, Wei W wrote: > On Tuesday, February 5, 2019 4:19 AM, Nitesh Narayan Lal wrote: >> The following patch-set proposes an efficient mechanism for handing fr= eed >> memory between the guest and the host. It enables the guests with no p= age >> cache to rapidly free and reclaims memory to and from the host respect= ively. >> >> Benefit: >> With this patch-series, in our test-case, executed on a single system = and >> single NUMA node with 15GB memory, we were able to successfully launch= >> atleast 5 guests when page hinting was enabled and 3 without it. (Deta= iled >> explanation of the test procedure is provided at the bottom). >> >> Changelog in V8: >> In this patch-series, the earlier approach [1] which was used to captu= re and >> scan the pages freed by the guest has been changed. The new approach i= s >> briefly described below: >> >> The patch-set still leverages the existing arch_free_page() to add thi= s >> functionality. It maintains a per CPU array which is used to store the= pages >> freed by the guest. The maximum number of entries which it can hold is= >> defined by MAX_FGPT_ENTRIES(1000). When the array is completely filled= , it >> is scanned and only the pages which are available in the buddy are sto= red. >> This process continues until the array is filled with pages which are = part of >> the buddy free list. After which it wakes up a kernel per-cpu-thread. >> This kernel per-cpu-thread rescans the per-cpu-array for any re-alloca= tion >> and if the page is not reallocated and present in the buddy, the kerne= l >> thread attempts to isolate it from the buddy. If it is successfully is= olated, the >> page is added to another per-cpu array. Once the entire scanning proce= ss is >> complete, all the isolated pages are reported to the host through an e= xisting >> virtio-balloon driver. > The free page is removed from the buddy list here. When will they get r= eturned to the buddy list so that the guest threads can use them normally= ? Once the host free the pages. All the isolated pages are returned back to the buddy. (This is implemented in hyperlist_ready()) > > Best, > Wei --=20 Regards Nitesh --PLnnUTd4vEqoEphvcp8R9SJ7Y1kub4KsV-- --wJpfxsrk2Gr0YRZLQdbt08sQsMIednBHY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkXcoRVGaqvbHPuAGo4ZA3AYyozkFAlxkCEkACgkQo4ZA3AYy oznBvw/+NpAiojgFLOk9fG0ZODJzn93xztizMxiSRXuQAMRkpAmC8h4Ld2X2ZWtd DTMHQg2FLNDDY20pPV1DFsJcVHnWk69V49mCLcsZ4KXjrVi8n7Wncr0ZXOsSoJB+ 0z1lRXHwhLwF/XZQLlV2uJtwgMUE1BnkVrlDRUpt9eZ4DYinPJwR0TD2fuSfoeaD fXVQavXp29XVDKP9Wk8pBvSa8ErYj4iR5zFVMtdOmC5Z/MkegIl8SaNHMoxGRVJX 4zroO7HxtFG70wSxyAg2p9i+S+jU/2Wcpcv8iHOq7FLzgoo8pYaKo4naIRl4JBl2 YnufdS4iSLAzdsA2a6iRzU0MKfmcDmxxiea3mma57YT9Qms8KM/v5LUyevXZ9S20 l6TX4utQCQXTHpG4OTxDp9UN5+lY2Is4DNilo5qrd37LQC1oQjbEkrJ0iHVdHY8x EzE0nOJNfw1bqAk6qzawUtUuQrJiU6e59ggiMzPN+98nlTP+ShcmQ9GVnSIzmz3A hM3Q4t2MSFfjYsgTwAo1YOAuxhHbKPIxEtxpEtjkkOnwrpq8wTY6mZA73WSAUsn5 gYIhulyNnc2ddJWqdPk9b0dRoBEPwNqqLCkp+RsETxzyWKMsYlaSGygmq/hIl8OO BcYTJLAvIa7xikYqbVndySFNQeCNEfAdKFwGb49tckFkR4oh2z0= =jfjl -----END PGP SIGNATURE----- --wJpfxsrk2Gr0YRZLQdbt08sQsMIednBHY--