xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/3] xen-blkfront: don't add indirect pages to list when !feature_persistent
       [not found] <1437547210-32573-1-git-send-email-bob.liu@oracle.com>
@ 2015-07-22  6:40 ` Bob Liu
  2015-07-22  6:40 ` [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt() Bob Liu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bob Liu @ 2015-07-22  6:40 UTC (permalink / raw)
  To: xen-devel; +Cc: Bob Liu, roger.pau, david.vrabel, linux-kernel

We should consider info->feature_persistent when adding indriect page to list
info->indirect_pages, else the BUG_ON() in blkif_free() would be triggered.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 drivers/block/xen-blkfront.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 3b193cf..5dd591d 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1125,8 +1125,10 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
 				 * Add the used indirect page back to the list of
 				 * available pages for indirect grefs.
 				 */
-				indirect_page = pfn_to_page(s->indirect_grants[i]->pfn);
-				list_add(&indirect_page->lru, &info->indirect_pages);
+				if (!info->feature_persistent) {
+					indirect_page = pfn_to_page(s->indirect_grants[i]->pfn);
+					list_add(&indirect_page->lru, &info->indirect_pages);
+				}
 				s->indirect_grants[i]->gref = GRANT_INVALID_REF;
 				list_add_tail(&s->indirect_grants[i]->node, &info->grants);
 			}
-- 
1.7.10.4

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

* [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()
       [not found] <1437547210-32573-1-git-send-email-bob.liu@oracle.com>
  2015-07-22  6:40 ` [PATCH v2 2/3] xen-blkfront: don't add indirect pages to list when !feature_persistent Bob Liu
@ 2015-07-22  6:40 ` Bob Liu
       [not found] ` <1437547210-32573-2-git-send-email-bob.liu@oracle.com>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bob Liu @ 2015-07-22  6:40 UTC (permalink / raw)
  To: xen-devel; +Cc: Bob Liu, roger.pau, david.vrabel, linux-kernel

The BUG_ON() in purge_persistent_gnt() will be triggered when previous purge
work haven't finished.
There is a work_pending() before this BUG_ON, but it doesn't account if the work
is still currently running.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
Change in v2:
 * Replace with work_busy()
---
 drivers/block/xen-blkback/blkback.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index ced9677..954c002 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -369,8 +369,8 @@ static void purge_persistent_gnt(struct xen_blkif *blkif)
 		return;
 	}
 
-	if (work_pending(&blkif->persistent_purge_work)) {
-		pr_alert_ratelimited("Scheduled work from previous purge is still pending, cannot purge list\n");
+	if (work_busy(&blkif->persistent_purge_work)) {
+		pr_alert_ratelimited("Scheduled work from previous purge is still busy, cannot purge list\n");
 		return;
 	}
 
-- 
1.7.10.4

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

* Re: [PATCH v2 2/3] xen-blkfront: don't add indirect pages to list when !feature_persistent
       [not found] ` <1437547210-32573-2-git-send-email-bob.liu@oracle.com>
@ 2015-07-23  8:59   ` Roger Pau Monné
  0 siblings, 0 replies; 6+ messages in thread
From: Roger Pau Monné @ 2015-07-23  8:59 UTC (permalink / raw)
  To: Bob Liu, xen-devel; +Cc: david.vrabel, linux-kernel

El 22/07/15 a les 8.40, Bob Liu ha escrit:
> We should consider info->feature_persistent when adding indriect page to list
                                                          ^ indirect
> info->indirect_pages, else the BUG_ON() in blkif_free() would be triggered.
> 
> Signed-off-by: Bob Liu <bob.liu@oracle.com>

Thanks, this looks correct indeed. If we are using persistent grants the
indirect_pages list should always be empty because blkfront has
pre-allocated enough persistent pages to fill all requests on the ring.

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Should be backported to stable branches.

Roger.

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

* Re: [PATCH v2 1/3] xen-blkfront: introduce blkfront_gather_backend_features()
       [not found] <1437547210-32573-1-git-send-email-bob.liu@oracle.com>
                   ` (2 preceding siblings ...)
       [not found] ` <1437547210-32573-2-git-send-email-bob.liu@oracle.com>
@ 2015-07-23  9:00 ` Roger Pau Monné
       [not found] ` <1437547210-32573-3-git-send-email-bob.liu@oracle.com>
  4 siblings, 0 replies; 6+ messages in thread
From: Roger Pau Monné @ 2015-07-23  9:00 UTC (permalink / raw)
  To: Bob Liu, xen-devel; +Cc: david.vrabel, linux-kernel

El 22/07/15 a les 8.40, Bob Liu ha escrit:
> There is a bug when migrate from !feature-persistent host to feature-persistent
> host, because domU still thinks new host/backend doesn't support persistent.
> Dmesg like:
> backed has not unmapped grant: 839
> backed has not unmapped grant: 773
> backed has not unmapped grant: 773
> backed has not unmapped grant: 773
> backed has not unmapped grant: 839
> 
> The fix is to recheck feature-persistent of new backend in blkif_recover().
> See: https://lkml.org/lkml/2015/5/25/469
> 
> As Roger suggested, we can split the part of blkfront_connect that checks for
> optional features, like persistent grants, indirect descriptors and
> flush/barrier features to a separate function and call it from both
> blkfront_connect and blkif_recover
> 
> Signed-off-by: Bob Liu <bob.liu@oracle.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

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

* Re: [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()
       [not found] ` <1437547210-32573-3-git-send-email-bob.liu@oracle.com>
@ 2015-07-23  9:06   ` Roger Pau Monné
       [not found]   ` <55B0AEB2.4070202@citrix.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Roger Pau Monné @ 2015-07-23  9:06 UTC (permalink / raw)
  To: Bob Liu, xen-devel; +Cc: david.vrabel, linux-kernel

El 22/07/15 a les 8.40, Bob Liu ha escrit:
> The BUG_ON() in purge_persistent_gnt() will be triggered when previous purge
> work haven't finished.
> There is a work_pending() before this BUG_ON, but it doesn't account if the work
> is still currently running.
> 
> Signed-off-by: Bob Liu <bob.liu@oracle.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Should be backported to stable branches.

Roger.

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

* Re: [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()
       [not found]   ` <55B0AEB2.4070202@citrix.com>
@ 2015-07-24 13:10     ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-07-24 13:10 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel, david.vrabel, linux-kernel

On Thu, Jul 23, 2015 at 11:06:58AM +0200, Roger Pau Monné wrote:
> El 22/07/15 a les 8.40, Bob Liu ha escrit:
> > The BUG_ON() in purge_persistent_gnt() will be triggered when previous purge
> > work haven't finished.
> > There is a work_pending() before this BUG_ON, but it doesn't account if the work
> > is still currently running.
> > 
> > Signed-off-by: Bob Liu <bob.liu@oracle.com>
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Should be backported to stable branches.

I applied all the patches and I am now testing them for regressions.

Thank you!
> 
> Roger.
> 

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

end of thread, other threads:[~2015-07-24 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1437547210-32573-1-git-send-email-bob.liu@oracle.com>
2015-07-22  6:40 ` [PATCH v2 2/3] xen-blkfront: don't add indirect pages to list when !feature_persistent Bob Liu
2015-07-22  6:40 ` [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt() Bob Liu
     [not found] ` <1437547210-32573-2-git-send-email-bob.liu@oracle.com>
2015-07-23  8:59   ` [PATCH v2 2/3] xen-blkfront: don't add indirect pages to list when !feature_persistent Roger Pau Monné
2015-07-23  9:00 ` [PATCH v2 1/3] xen-blkfront: introduce blkfront_gather_backend_features() Roger Pau Monné
     [not found] ` <1437547210-32573-3-git-send-email-bob.liu@oracle.com>
2015-07-23  9:06   ` [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt() Roger Pau Monné
     [not found]   ` <55B0AEB2.4070202@citrix.com>
2015-07-24 13:10     ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).