[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [PATCH] mem_sharing: fix race condition of nominate and unshare



At 04:42 +0000 on 13 Jan (1294893768), MaoXiaoyun wrote:
> Well, I think the discuss is around get_page/put_page, 
> get_page_type/put_page_type
> 
> Could someone help to explain their usage and difference?

The reference counting mechanism is described at the top of
xen/arch/x86/mm.c.  get_page() takes a "TOT_COUNT" reference;
get_page_type() takes a "TYPE_COUNT" reference; get_page_and_type()
takes both. 

Cheers,

Tim.

> > Date: Thu, 13 Jan 2011 10:26:55 +0800
> > Subject: Re: [PATCH] mem_sharing: fix race condition of nominate and unshare
> > From: juihaochiang@xxxxxxxxx
> > To: tinnycloud@xxxxxxxxxxx
> > CC: tim.deegan@xxxxxxxxxx; xen-devel@xxxxxxxxxxxxxxxxxxx
> >
> > Hi, all:
> >
> > I think there is still a problem.
> > (1) I think using the get_page_and_type is definitely better since
> > it's a function already implemented there
> > There seems a typo:
> > "if ( get_page_and_type(page, d, PGT_shared_page) )" should be changed
> > to "if ( !get_page_and_type(page, d, PGT_shared_page) )" because the
> > function return 1 on success.
> >
> > (2) The major problem is the __put_page_type() never handle the
> > special case for shared pages.
> >
> > If the (1) is changed as I said, the problem still exists as the following
> > /* Before nominating domain 1, gfn 0x63 */
> > (XEN) Debug for domain=1, gfn=63, Debug page: MFN=4836c7 is
> > ci=8000000000000002, ti=0, owner_id=1
> > /* After a failed nominate [desired: ci=8000000000000002, ti=0]*/
> > (XEN) Debug for domain=1, gfn=63, Debug page: MFN=4836c7 is
> > ci=8000000000000002, ti=8400000000000000, owner_id=1
> >
> >
> > 2011/1/12 MaoXiaoyun <tinnycloud@xxxxxxxxxxx>:
> > > Hi Tim:
> > >
> > >         That's it, I am running the test, so far so good, I'll test more,
> > > thanks.
> > >
> > >       Currently from the code of tapdisk, it indicates only *read only* IO
> > > with secs 8 has the
> > > chance to be shared, so does it mean only the parent image can be shared,
> > > still it needs to
> > > be opened read only, right?
> > >
> > >       So it looks like page sharing are refer to those pages contain disk
> > > data been loaded
> > > into Guest IO buffer, and this is the page sharing in Xen, right?
> > >
> > >
> >
> > Bests,
> > Jui-Hao

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.