WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] RE: Memory sharing, is it possible a page is freed in Do

To: pengfei zhang <zpfalpc23@xxxxxxxxxxx>
Subject: Re: [Xen-devel] RE: Memory sharing, is it possible a page is freed in DomU on its way to be shared?
From: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
Date: Wed, 20 Apr 2011 11:15:54 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 19 Apr 2011 20:16:47 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0HxKG8ezWiAJUracXoTudi/AP4RFOvcrpJtyr4KI9o4=; b=OWyWyh17qCV+8Y044G7dAyJudCHIgkWbH5Mn+MkOcgqTpj0pZX/IDh51yZnKi+8Bk2 fAfYufLDofbCX5FhM+2jHJvsh5AtJm3zROQO1qhrVzxgO9cKdeyN2WusGQ2c1s1V2zSc km0IHU9gO+rR/GM7hqJAjKsgl6X+dUZBnR350=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=GjYg1/Z3L+MFcv2VSSS75WVVRbU8sktcxu1W8tGr8WfLpuyrRO6sktIgAJnrkD99l1 tMz/h2ZpuoskZdQSPLBgMJFOSCCEwZJdyLFErhFpPWCb24rvGhVRL90YDaSDkby/Xhor jX11y0Ujyx1zOSKs8RdFrz2dgm5pp5AdVNkX4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <SNT132-w3319170568164AD548FD72BC900@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BLU157-w329C4D6B99C392117F806CDA900@xxxxxxx> <SNT132-w3319170568164AD548FD72BC900@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

I remember Tim said there already exist potential problem in p2m type,
and could be taken care of after 4.1 is released.
Forget about mem_sharing first, say if I want to grab a page that no
other Xen code can touch and use, how do I do it in the current Xen?
I guess this should not be a problem only for mem_sharing.

The other solution I am thinking is to use the RCU write lock in
mem_sharing can solve the race condition on p2m type.
But it seems the RCU mechanism favors the reader but not the writer,
in our case, the mem_sharing code.
If that's the case, then the mem_sharing operation will block for a
long period, e.g. the guest page fault triggers unshare(), and degrade
the response time of guest domain.

Bests,
Jui-Hao

On Tue, Apr 19, 2011 at 10:46 PM, pengfei zhang <zpfalpc23@xxxxxxxxxxx> wrote:
>
> After thinking of this problem for some time, I think this situation can not 
> happen for my point of view.
> After the block disk driver has get the request from I/O dispatcher, if the 
> buffer memory is freed for other use,
> no one will notify the driver about this, and this will cause data 
> reading conflict. So the kernel must do something(protect the buffer until 
> response from driver?) to avoid this.
> ________________________________
> Date: Tue, 19 Apr 2011 06:27:46 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Memory sharing, is it possible a page is freed in DomU on its way to 
> be shared?
>
> Hi:
>
>       Just come up this question.
>
>       Say a process in domU read IO, then blkfront driver will have a new 
> page prepared to
> fill the IO data. The blkfront pass the gref to blkback in dom0, later 
> passed  to blktap, then
> forward to  tapdisk for physical IO read, in memory sharing, the gref may be 
> nominate to
> Xen for page sharing again( say this is sharing step).
>
>       My question is, it is possible during the IO data comes back from 
> tapdisk, the page
> referred by gerf in domU could be freed? (maybe by process termination, or 
> blkfront free this page)
>
>      And if it is possible, then the page is free in domU, it is also 
> possible that the page be given
> back to Xen through ballloon driver, and the P2M will be invaild.  This may 
> make *sharing step*
> gfn points to a invalid mfn possible.
>
>      So is this possible happen?
>
>      thanks.
>
>
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> [hidden email]
> http://lists.xensource.com/xen-devel
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion 
> below:
> http://xen.1045712.n5.nabble.com/Memory-sharing-is-it-possible-a-page-is-freed-in-DomU-on-its-way-to-be-shared-tp4313262p4313262.html
> To unsubscribe from Xen, click here.
> ________________________________
> View this message in context: RE: Memory sharing, is it possible a page is 
> freed in DomU on its way to be shared?
> Sent from the Xen - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel