From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nitesh Narayan Lal Subject: Re: [PATCH 2/3] KVM: Guest page hinting functionality Date: Wed, 2 Aug 2017 16:37:57 -0400 Message-ID: <5fdf803a-d28d-33dd-c4e2-88791b3f248e@redhat.com> References: <20170801204806.23938-1-nilal@redhat.com> <20170801204806.23938-3-nilal@redhat.com> <414002282.37988665.1501657308398.JavaMail.zimbra@redhat.com> <5ed83f54-12c9-b2c7-bec5-d0a57e5e310e@redhat.com> <1501701646.26846.57.camel@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gXKBuT8KAX4oWn253B814J4K8vtXxo5Cj" Cc: kvm@vger.kernel.org, mst@redhat.com, david@redhat.com, yang.zhang.wz@gmail.com, wei.w.wang@intel.com, mst@redhat.com, david@redhat.com, yang.zhang.wz@gmail.com, wei.w.wang@intel.com To: Rik van Riel , Pankaj Gupta Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37018 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751739AbdHBUiM (ORCPT ); Wed, 2 Aug 2017 16:38:12 -0400 In-Reply-To: <1501701646.26846.57.camel@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gXKBuT8KAX4oWn253B814J4K8vtXxo5Cj Content-Type: multipart/mixed; boundary="1XgVig2OR9sCaQKGP2mFUGGJfiEn5SaUw"; protected-headers="v1" From: Nitesh Narayan Lal To: Rik van Riel , Pankaj Gupta Cc: kvm@vger.kernel.org, mst@redhat.com, david@redhat.com, yang.zhang.wz@gmail.com, wei.w.wang@intel.com, mst@redhat.com, david@redhat.com, yang.zhang.wz@gmail.com, wei.w.wang@intel.com Message-ID: <5fdf803a-d28d-33dd-c4e2-88791b3f248e@redhat.com> Subject: Re: [PATCH 2/3] KVM: Guest page hinting functionality References: <20170801204806.23938-1-nilal@redhat.com> <20170801204806.23938-3-nilal@redhat.com> <414002282.37988665.1501657308398.JavaMail.zimbra@redhat.com> <5ed83f54-12c9-b2c7-bec5-d0a57e5e310e@redhat.com> <1501701646.26846.57.camel@redhat.com> In-Reply-To: <1501701646.26846.57.camel@redhat.com> --1XgVig2OR9sCaQKGP2mFUGGJfiEn5SaUw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US On 08/02/2017 03:20 PM, Rik van Riel wrote: > On Wed, 2017-08-02 at 14:59 -0400, Nitesh Narayan Lal wrote: >>>> -struct hypervisor_pages hypervisor_pagelist[MAX_FGPT_ENTRIES]; >>>> +struct hypervisor_pages hypervisor_pagelist[MAX_FGPT_ENTRIES - >>>> 1]; >>>> + >>>> +static void empty_hyperlist(void) >>>> +{ >>>> + int i =3D 0; >>>> + >>>> + while (i < MAX_FGPT_ENTRIES - 1) { >>> MAX_FGPT_ENTRIES in-place of 'MAX_FGPT_ENTRIES - 1' here >>> and at similar other places? >> This is because CPU local list has a total of 1000 entries >> (MAX_FGPT_ENTRIES) where as CPU global list has 999 entries. If you >> see >> the arch_free_page_slowpath() and consider a situation where there >> are >> 1000 entries of singly allocated free pages in cpu-local list i.e., >> none >> of them are re-allocated. While adding them to the cpu global list >> when >> cpu local list index reaches to 1000 the outer loop will terminate >> due >> to which cpu global list index will never reach to 1000 and >> compress_hyperlist()/make_hypercall() will never be called. > Can you explain why the hypervisor_pagelist > is smaller than the cpu local list? > > This makes no sense to me. Why are they not > the same size? > > That would certainly make the code easier to read. I am sorry. There is no point of complicating things when it could be done in a simpler way. I will make the required changes in my next patch-set. --=20 Regards Nitesh --1XgVig2OR9sCaQKGP2mFUGGJfiEn5SaUw-- --gXKBuT8KAX4oWn253B814J4K8vtXxo5Cj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZgjgmAAoJEKOGQNwGMqM5BR4P/RfKUX5dqH7nRVO8LLyNtSy3 ICiE4o3s0RjTvIlXyxD5hQ3aUPrkpjc+y3R5egVqggaIZmZmpwEaCxF4h9UugctW kA3IZLsajVUxhDyiBev/JFGYOYN91h6tsN/myE51OQlfjL8eV/V8q2nyc2uY9X/6 09MUWgxAJ+BTX/fp4UrylP6dRQ6XFyKtaTvWe0JQqrAdo55EIo4C+G7/4QJEEg+0 MDSK+ESOu9ZrLaHkAOxGB/sshpzXKvKngkbmUkPwoVHlpgzH8cvkMDei+Y9Zo3LW 46a4UQQqZceQq5Sctt6FH/0XaxHa91M7x9V4AIiW2rNf6EPmjR2lI5+YFGbvtH5E y0iT0wQA13UaqYhINCsg+7db9xgyCvvAvE+scX6fcKIbHHJylaml73IFCkFVpgAb /pS+BxJNsvzGQHgeL01fa6E7pdvYkJwOA+sAxA4uGPtbYwgxmOpHPDgXgHYwg+Ne 1f0QmI9IhHXqIgSXMQdAZ8jdzhDy9CQ4NezQtfJ0VTguVqvapc2/IZ7SfLPQm66u 3GB9uJ9RgY+I83QVBiPS2ewnQ3CXcGPECni7rVmnxbkFd1xymQgGh7w63IGHJ5cu Jltj1q8OTO5kXcadYFhzqqYl315MXlcFv5FNPdr0eLcqrzYBuv/46islkYSeXnAt SJ0cH2xSthqavcExM6iL =bKDD -----END PGP SIGNATURE----- --gXKBuT8KAX4oWn253B814J4K8vtXxo5Cj--