mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xen/blkfront: When purging persistent grants, keep them in the buffer
@ 2018-09-22 19:55 Boris Ostrovsky
  2018-09-27  7:12 ` Juergen Gross
  0 siblings, 1 reply; 12+ messages in thread
From: Boris Ostrovsky @ 2018-09-22 19:55 UTC (permalink / raw)
  To: jgross, konrad.wilk, roger.pau, axboe
  Cc: xen-devel, linux-kernel, Boris Ostrovsky

Commit a46b53672b2c ("xen/blkfront: cleanup stale persistent grants")
added support for purging persistent grants when they are not in use. As
part of the purge, the grants were removed from the grant buffer, This
eventually causes the buffer to become empty, with BUG_ON triggered in
get_free_grant(). This can be observed even on an idle system, within
20-30 minutes.

We should keep the grants in the buffer when purging, and only free the
grant ref.

Fixes: a46b53672b2c ("xen/blkfront: cleanup stale persistent grants")
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 drivers/block/xen-blkfront.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index a71d817e900d..3b441fe69c0d 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2667,11 +2667,9 @@ static void purge_persistent_grants(struct blkfront_info *info)
 			    gnttab_query_foreign_access(gnt_list_entry->gref))
 				continue;
 
-			list_del(&gnt_list_entry->node);
 			gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
+			gnt_list_entry->gref = GRANT_INVALID_REF;
 			rinfo->persistent_gnts_c--;
-			__free_page(gnt_list_entry->page);
-			kfree(gnt_list_entry);
 		}
 
 		spin_unlock_irqrestore(&rinfo->ring_lock, flags);
-- 
2.17.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-09-28  6:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-22 19:55 [PATCH] xen/blkfront: When purging persistent grants, keep them in the buffer Boris Ostrovsky
2018-09-27  7:12 ` Juergen Gross
2018-09-27 14:26   ` Jens Axboe
2018-09-27 18:52     ` [Xen-devel] " Sander Eikelenboom
2018-09-27 18:56       ` Jens Axboe
2018-09-27 19:06         ` Boris Ostrovsky
2018-09-27 19:16           ` Jens Axboe
2018-09-27 20:33           ` Sander Eikelenboom
2018-09-27 21:37             ` Jens Axboe
2018-09-27 21:48               ` Boris Ostrovsky
2018-09-27 22:03                 ` Sander Eikelenboom
2018-09-28  6:44                   ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome