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

Re: [PATCH v10] xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE


  • To: Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Date: Sun, 10 Jul 2022 22:11:45 +0000
  • Accept-language: en-US, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=snIwBG6HQyuyLhuLbg2nDk33La6TnIs4V8U4r6xt4Ck=; b=Jd+/SLLIXTRKVS0+KnY1x9tWp3Qmtk0Tkw97Oq1I/VUYvnNKlWUHJrdi7Jubvn1W+pnAsB6DSzFFoAwZZubLDMZn74i0fNE0KKvKlIf9mGgHSpGsexc38IkcSuRhd3cftxXsHcv3IuzacIfNE1TyZiOCHbuP4Wm09fsM1FJBYkV+Gtyis/SGzRlb0BE+XAn5wb0BK/kK8Txb9qfs9UiMxTfVQjlo2PSJe7PhkxPXtF63Mqr55zAWDrTzbxGY3mjxn6Lv4YDJset1QVxZE6TCSq8FTRb15DakTqTkt5Rfs9Jf+JTDvJSahDkJfJCDkG1j9AQd0ZSz4AWVm9ozEatQdA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nmWy954NtvBhV+7D25hwEgEpRylp4Nyku7Q1LNsX0zupYm2yutdkNzhEZ2A8B2ga9vQ3K0m8U0XDKVvFGgpQ4KjFpafCQ12ZuLvK+JvyukgaznuN5cexQNCWTd1xdRrwMG+7zF7CyjOHZRoMmr08fR7Q7kG1LK/Xycdo07GUa5z2jdjIrPidj6EikwuySI+3xNjHwQMvMZ5h04utupeCU0K2z5/JVZmzzHNBXq/kZAC/ZtMbw2XhBfBrLtyOv4a/NbODRZGZgDo0VVCV6yuefWh29Q6cC1tH/giysvcPpje/NBqzICSeAlvrf7Jj8T+hBOMao42tbhYweZPxpjQ6Mw==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "stable@xxxxxxxxxxxxxxx" <stable@xxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Sun, 10 Jul 2022 22:12:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYlKe9qMC33m5o/0mYv55xFOoM+614KsWA
  • Thread-topic: [PATCH v10] xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE

On 11.07.22 00:54, Demi Marie Obenour wrote:


Hello Demi Marie

> The error paths of gntdev_mmap() can call unmap_grant_pages() even
> though not all of the pages have been successfully mapped.  This will
> trigger the WARN_ON()s in __unmap_grant_pages_done().  The number of
> warnings can be very large; I have observed thousands of lines of
> warnings in the systemd journal.
>
> Avoid this problem by only warning on unmapping failure if the handle
> being unmapped is not INVALID_GRANT_HANDLE.  The handle field of any
> page that was not successfully mapped will be INVALID_GRANT_HANDLE, so
> this catches all cases where unmapping can legitimately fail.
>
> Suggested-by: Juergen Gross <jgross@xxxxxxxx>
> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
> Fixes: dbe97cff7dd9 ("xen/gntdev: Avoid blocking in unmap_grant_pages()")


Next time please add a changelog, also I assume current patch ought to 
be v2 instead of v10)


> ---
>   drivers/xen/gntdev.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
> index 
> 4b56c39f766d4da68570d08d963f6ef40c8d9c37..44a1078da21b8a2333b4432900a8dbdfb8e13c53
>  100644
> --- a/drivers/xen/gntdev.c
> +++ b/drivers/xen/gntdev.c
> @@ -396,13 +396,15 @@ static void __unmap_grant_pages_done(int result,
>       unsigned int offset = data->unmap_ops - map->unmap_ops;
>   
>       for (i = 0; i < data->count; i++) {
> -             WARN_ON(map->unmap_ops[offset+i].status);
> +             WARN_ON(map->kunmap_ops[offset + i].status != GNTST_okay &&
> +                     map->kunmap_ops[offset + i].handle != 
> INVALID_GRANT_HANDLE);


s/kunmap_ops/unmap_ops


[snip]


-- 
Regards,

Oleksandr Tyshchenko

 


Rackspace

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