From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: [PATCH 2/3] KVM: Guest page hinting functionality Date: Wed, 02 Aug 2017 15:20:46 -0400 Message-ID: <1501701646.26846.57.camel@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> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-teFtAglCAF0oaddhawWB" Cc: kvm@vger.kernel.org, mst@redhat.com, david@redhat.com, yang.zhang.wz@gmail.com, wei.w.wang@intel.com To: Nitesh Narayan Lal , Pankaj Gupta Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51160 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbdHBTVH (ORCPT ); Wed, 2 Aug 2017 15:21:07 -0400 In-Reply-To: <5ed83f54-12c9-b2c7-bec5-d0a57e5e310e@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: --=-teFtAglCAF0oaddhawWB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2017-08-02 at 14:59 -0400, Nitesh Narayan Lal wrote: >=20 > > > -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) { > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0MAX_FGPT_ENTRIES in-place of 'MAX_F= GPT_ENTRIES - 1' here > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0and at similar other places? >=20 > 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. > >=20 >=20 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. --=20 All rights reversed --=-teFtAglCAF0oaddhawWB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJZgiYPAAoJEM553pKExN6Dha0H/3YLZ/9V/PShdkNsBx2613n2 /XZxyp1q0ksySPdE4HHjtBD/vz2NCfq1MmZk52zetAEUwAVU+S87ASHXMHGwDL5h KEuSznO1PAurnjyhV7KGFO5Bko1nEE0VAhogwrBC8f7Nr+YNpAuBBEFwKjOaYjXu nT5X2UY5i4EZW6ZnNTrwu465eEk7jSOfgs8KPi4vV0+/aeU/0nynro81oDtDuXzm SeaMg9XD9V5+qcyBMNuiRpIi27Wn9cADqLPghsgHU6N3pSrlM6vZ1eHKLNY5ze9r +Mk6XN54EgAKz2Km9sO0B/2j5/99hPIpRCnKZBxUjGcviW6MCaPguRu6OkdkOJU= =Hcde -----END PGP SIGNATURE----- --=-teFtAglCAF0oaddhawWB--