From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jui-Hao Chiang Subject: Re: RE: Memory sharing, is it possible a page is freed in DomU on its way to be shared? Date: Wed, 20 Apr 2011 11:15:54 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: pengfei zhang Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 wro= te: > > 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 t= he buffer memory is freed for other use, > no one will notify the driver about this, and this will cause data readin= g=A0conflict. So the kernel must do something(protect the buffer until resp= onse 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 wa= y to be shared? > > Hi: > > =A0=A0=A0=A0=A0=A0Just come up this question. > > =A0=A0=A0=A0=A0 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,=A0later = passed=A0 to blktap,=A0then > forward to=A0 tapdisk for physical IO read, in memory sharing, the gref= =A0may be nominate to > Xen for page sharing again( say this is sharing step). > > =A0=A0=A0=A0=A0=A0My question is, it is possible during the IO data comes= back from tapdisk,=A0the page > referred by gerf in domU could be freed? (maybe by=A0process termination,= or blkfront free this page) > > =A0=A0=A0=A0=A0And if it is possible, then the page is free in domU, it i= s also possible that the page be given > back to Xen through ballloon driver, and the P2M=A0will be invaild.=A0 Th= is may make *sharing step* > gfn points to a invalid mfn possible. > > =A0=A0=A0=A0 So is this possible=A0happen? > > =A0=A0=A0=A0 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 i= s 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@lists.xensource.com > http://lists.xensource.com/xen-devel >