[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.17 v1 0/2] xenctrl.ml: improve scalability of domain_getinfolist


  • To: Christian Lindig <christian.lindig@xxxxxxxxxx>
  • From: Edwin Torok <edvin.torok@xxxxxxxxxx>
  • Date: Wed, 2 Nov 2022 09:31:11 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2DhY5H+/0wbCMl95XLJ2Ekls9iBh3MHnpW/yKvtLgaM=; b=QGrSISuxwoLjZlxdGZu2Zggem5/jNPtje5RpXgKXJXdeFNdIWKbWnEP4JnqCRNmjj97H/Y14pK//WAUFAUYTVQltwZXpOzsTiF7zX9pjG9CWuXTKYxXwgiPMRKIPSWA6qGy0sgteo2rYrvybcH04S5ubsXqSeyej4WxUMxCvZexGLSUa7NeY/tC5Z4tjOvaNd5QlyouijV44xSeTOBaeFjuCZGdpxHBEi6XLVzPMm2Y1WpCoXLVQIRgMWvS8ux+pyZdUw3ybLidsx0O8hEpzanPKL2oTQ05027LMrzM5AvyYF+DY7fQoJ6d4lcPrUxDtd/Z5fdYpSLez97gc9q0rew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HXKatotv+pKx1Y/04ERK2tzaxPOg/hIgMHNVAIOL/xFMaYZYLPpZePZgMBqms+xmU71LUQywCapNPu070KgN9PMDcKx8gQsVeWJcRwmcTfU8VSFFsy4fjuTopJk1dvO+TT6tX8no7gRN9HV8o4j2KgB10VRjbwlyE/vv4M1nrpIu53jQNdEZECSrAlaN2Gpg9FT7ULRSaevjBG7f+bLvIt0zAjPM7GmYpqA2dCG8fyN1xw6jgho0cKTNQbu7dp2iqYnb0IqeR4gz1mdSr4LQcbnXXgdYUSPwRGdlzto3UvHaKKurgBwhnvJekV9BhmN9v15pSFESOGH8wIQuhzyy2Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Pau Ruiz Safont <pau.safont@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 02 Nov 2022 09:32:20 +0000
  • Ironport-data: A9a23:V82CsqprHmY+0XFbSp6y3nBwt25eBmI8ZBIvgKrLsJaIsI4StFCzt garIBmDOa3cY2f0LtAkPdnlox5T7MeGy95lS1A6+X88ES5G8puZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpAFc+E0/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06W5wUmAWP6gR5gaHzyNNVfrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXABRSb0yi3f3t+/GQGvtNgeQvccLMZZxK7xmMzRmBZRonabbqZv2WoPN9gnI3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3j+OrbIW9lt+iHK25mm6Vq nzH+SLlBQsdN/SUyCaf82LqjejK9c/+cNJOSOTmqqE66LGV7kJUUCQqbUOWm8KCpGOkWs1aC RYpoiV7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3Oc6TCIn/ kWElNToAXpoqrL9YW2Z3qeZq3W1Iyd9EIMZTSoNTA9A79y9pog21k7LVow7TPHzicDpEzbtx TzMtDI5m7gYkc8M0eO84EzDhDWv4JPOS2bZ+znqY45s1SshDKbNWmBiwQGzASpoRGpBcmS8g Q==
  • Ironport-hdrordr: A9a23:kAA6FK4np4yXttbTIgPXwWuBI+orL9Y04lQ7vn2ZFiY5TiXIra qTdaogviMc0AxhI03Jmbi7Scq9qeu1z+853WBjB8bZYOCAghrlEGgC1/qp/9SEIUHDH4FmpM BdmsRFaeEYSGIK9foSgzPIXOrIouP3lpxA7N22pxgCcegpUdAY0+4TMHf4LqQCfngjOXNPLu v42iMonVqdUEVSSv7+KmgOXuDFqdGOvonhewQ6Cxku7xTLpS+06ZbheiLonys2Yndq+/MP4G LFmwv26uGIqPeg0CLR0GfV8tB/hMbh8N1eH8aB4/JlagkEyzzYJ7iJaYfy+Qzdk9vfrGrCV+ O85CvICv4DqU85uFvF5ycFlTOQiQrGoEWStGNwyUGT3fARAghKRfapzLgpDCfx+g4uuspx37 lM2H/cv51LDQnYlCC4/NTQUQp2/3DE6EbLAYYo/gNiuKYlGchsRLYkjTVoOYZFGDi/5JEsEe FoAs2Z7PFKcUmCZ3ScumV02tSjUnk6Ax/DGyE5y4eo+ikTmGo8w1oTxcQZkHtF/JUhS4Nc7+ CBNqhzjrlBQsIfcKo4DuYcRsm8DHDLXHv3QSqvCEWiELtCN2PGqpbx7rlw7Oa2eIYQxJ93g5 jFWEMwjx9HR6svM7z64HRmyGG/fIzmZ0Wd9ih33ekIhpTsALz2LCaEVFci18O9vvR3OLyoZ8 qO
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHY7hu6Hfeu3cnxk0m/6L4xh+MTgK4rWegAgAAFhIA=
  • Thread-topic: [PATCH for-4.17 v1 0/2] xenctrl.ml: improve scalability of domain_getinfolist


> On 2 Nov 2022, at 09:11, Christian Lindig <christian.lindig@xxxxxxxxxx> wrote:
> 
> 
> 
>> On 1 Nov 2022, at 17:59, Edwin Török <edvin.torok@xxxxxxxxxx> wrote:
>> 
>> 
>> Edwin Török (2):
>> xenctrl.ml: make domain_getinfolist tail recursive
>> xenctrl: use larger chunksize in domain_getinfolist
>> 
>> tools/ocaml/libs/xc/xenctrl.ml | 25 ++++++++++++++++++-------
>> 1 file changed, 18 insertions(+), 7 deletions(-)
> 
> Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>
> 
> 
>> It was calling the Xen domainfolist hypercall N/2 times.
>> Optimize this such that it is called at most 2 times during normal use.
>> 
>> Implement a tail recursive `rev_concat` equivalent to `concat |> rev`,
>> and use it instead of calling `@` multiple times.
> 
> Are there any assurances about the order in elements returned by 
> domain_getinfolist? I understand that the change maintains the current 
> behaviour but are we even required to maintain that order? Because otherwise 
> we could return the reverse list and save more work.


Maintaining the current (reversed) order in the C stubs is useful to be able to 
extract the largest domid so we know where to continue.
However we don't necessarily have to maintain the order on the higher level 
function available in the .mli, it just happens that `rev_concat` gives us the 
results in the order that we want.

Although perhaps using an array rather a list here might be better, and we 
could move resizing/reallocing that array into the C stub, and have just a 
nicer (and perhaps faster) interface in the C/OCaml API,
by producing less garbage than lists (a single Array.t allocation rather than N 
list elements).
(Although I don't usually like pushing complexity like that into C stubs, for 
now I'm happy with the performance of the code as is).

There are more issues in these C stubs in xenctrl, I'll be pouring over the 
code and try to send a few more patches.

Best regards,
--Edwin

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.