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

Re: [PATCH V2 2/7] xen/grants: support allocating consecutive grants


  • To: Oleksandr <olekstysh@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Wed, 11 May 2022 17:09:33 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.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=FASIeEUl1pX/XPtEFTSF4e42NLZ0OSScKjkvXRCXnGI=; b=YrPMgcCQp3e7Xw8cy4axVnUop3baYBFUhxglb12L1aAVH0VbpMRoNTN7kep+n1GFp54CJB1UfTHkJJeB2q+QsDrtWMNuKDYjgLGZMfmUe67K5owm6D6dh1DWgkd0SR6oDr2WlrJDtucPVttqMr89di4pReaDhLZU+wX1A5ouU38PjewIpXojM2stCHYDn3OxcLfxRa/WBcTxy5WvHz6K4/YEV+l4WWdF7DGy2qBadzXFc1sBJstfyCcAX0mc+oTwXqSOdEnyx8HoqvjHIPegFAUxzwWeax8aOM8TxexwEutCVb2KTOUVjrmpz/utcfvJ0TH+aiIeU+PnPZyvzqMO8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lrzI2kbDIJu3Nw7mWh+Nw4x/BAVusUt75Lb7CLWKODm93YhoEj2aYTmhj2cZZuXq0MK9LpuQ/m0vDvSJWmCynQrBG9U96tcmu9NLmLdcrR4FeMvDPkDtK5iHxslDRfpJKdvScl31Y9r9pcOdVP4vQrqxW7adz2LBsFJvMgAOE+ghi3IJCvsntuR7hdPdjHadbIk6sE11NDdvh1TluGjC0gg+qQFcxpxZpRde3dnv01mjlqkQxxs/Yd13CE3Xj4+YZ8UIsWK4S8ziM5AwaF/o8WixWk9zkMxUTvq6jJ5EXqrzD7azU+2wDqYGf58b8/mRoh/QHbVN0TVthzg21pPBZg==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>
  • Delivery-date: Wed, 11 May 2022 21:10:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 5/11/22 2:00 PM, Oleksandr wrote:

On 07.05.22 21:19, Oleksandr Tyshchenko wrote:

Hello Boris, Stefano


From: Juergen Gross <jgross@xxxxxxxx>

For support of virtio via grant mappings in rare cases larger mappings
using consecutive grants are needed. Support those by adding a bitmap
of free grants.

As consecutive grants will be needed only in very rare cases (e.g. when
configuring a virtio device with a multi-page ring), optimize for the
normal case of non-consecutive allocations.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
Changes RFC -> V1:
    - no changes
    Changes V1 -> V2:
    - no changes


May I please ask for the review here?



I had a quick look but I am stuck on get_free_seq(), I need to stare at it some 
more. Unless someone else reviews this, I will try to get to this in the next 
couple of days.


One thing I did notice is



@@ -1452,6 +1624,13 @@ int gnttab_init(void)
          }
      }
  +    i = gnttab_interface->grefs_per_grant_frame * max_nr_grant_frames;
+    gnttab_free_bitmap = bitmap_zalloc(i, GFP_KERNEL);
+    if (!gnttab_free_bitmap) {
+        ret = -ENOMEM;
+        goto ini_nomem;
+    }


This overwrites 'i' and will break error handling at ini_nomem.


-boris





 


Rackspace

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