All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH v3] xen-blkfront: set pages are FOREIGN_FRAME when sharing them
Date: Thu, 10 May 2012 12:12:40 -0400	[thread overview]
Message-ID: <20120510161240.GA3215@phenom.dumpdata.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1205091849580.26786@kaball-desktop>

On Wed, May 09, 2012 at 07:42:33PM +0100, Stefano Stabellini wrote:
> On Tue, 8 May 2012, Stefano Stabellini wrote:
> > I have been unable to reproduce this problem (I haven't given up yet)
> > but I bet that the following patch fixes it:
> > 
> > 
> > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> > index e3a9945..88e9304 100644
> > --- a/drivers/block/xen-blkfront.c
> > +++ b/drivers/block/xen-blkfront.c
> > @@ -333,7 +333,7 @@ static int blkif_queue_request(struct request *req)
> >  					buffer_mfn,
> >  					rq_data_dir(req));
> >  
> > -			info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn);
> > +			info->shadow[id].frame[i] = buffer_pfn;
> >  			ring_req->u.rw.seg[i] =
> >  					(struct blkif_request_segment) {
> >  						.gref       = ref,
> > 
> > 
> > The idea is that the request contains a page for which
> > 
> > pfn->mfn->pfn == 0xffffffffffffffff
> > 
> > I am not sure exactly how it could be possible to get into this state in
> > blkfront, I hope that some more tracing and code reading will be able to
> > shed some lights on the issue.
> 
> The one line patch fixes the issue: when using LVM in the guest the same
> page can be used in two different requests (in blkif_queue_request)
> before being unmapped.
> The second time mfn_to_pfn is going to return ~0 because buffer_mfn has
> the FOREIGN_FRAME_BIT set.
> But actually we don't need to call mfn_to_pfn at all because we already
> know the pfn value, that is stored in buffer_pfn.
> 
> However the real problem remains at the time of blkif_completion: we
> will remove the FOREIGN_FRAME_BIT before the other requests have been
> completed.
> 
> If sharing the same page twice (or more) is a normal condition then I
> might have to revisit this patch completely and choose another
> strategy...

Ok, will wait for that and in the meantime drop the patch so I can
send a git pull to Jens.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

      reply	other threads:[~2012-05-10 16:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 16:25 [PATCH v3] xen-blkfront: set pages are FOREIGN_FRAME when sharing them Stefano Stabellini
2012-04-16 19:52 ` Konrad Rzeszutek Wilk
2012-04-17 10:58   ` Stefano Stabellini
2012-05-07 21:25     ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-05-07 21:37       ` Konrad Rzeszutek Wilk
2012-05-08 17:29       ` Stefano Stabellini
2012-05-09 18:42         ` Stefano Stabellini
2012-05-10 16:12           ` Konrad Rzeszutek Wilk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120510161240.GA3215@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=konrad@darnok.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.