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

Re: [Xen-devel] [PATCH v4 8/9] xen/arm: Implement hypercall for dirty page tracing



> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxx [mailto:xen-devel-
> bounces@xxxxxxxxxxxxx] On Behalf Of Ian Campbell
> Sent: Thursday, October 17, 2013 8:47 PM
> To: Jaeyong Yoo
> Cc: 'Stefano Stabellini'; xen-devel@xxxxxxxxxxxxx
> Subject: Re: [Xen-devel] [PATCH v4 8/9] xen/arm: Implement hypercall for
> dirty page tracing
> 
> On Thu, 2013-10-17 at 20:05 +0900, Jaeyong Yoo wrote:
> > > >
> > > > >
> > > > > > +    {
> > > > > > +        lpae_t pte = *vlp2m_pte;
> > > > > > +        pte.p2m.write = 1;
> > > > > > +        write_pte(vlp2m_pte, pte);
> > > > > > +        flush_tlb_local();
> > > > > > +
> > > > > > +        /* in order to remove mappings in cleanup stage */
> > > > > > +        add_mapped_vaddr(d, addr);
> > > > >
> > > > > No locks or atomic operations here? How are races with the tools
> > > > > reading the dirty bitmap addressed?  If it is by clever ordering
> > > > > of the checks and pte writes then I think a comment would be in
> order.
> > > >
> > > > Actually, the lock is inside the add_mapped_vaddr function.
> > >
> > > But that only covers the bitmap update, not the pte frobbing.
> >
> > I also locked with the same lock at the get_dirty_bitmap which is
> > reading the bitmap.
> 
> I meant the pte frobbing immediately before the call the add_mapped_vaddr
> quoted above.
> 

I don't think it is necessary because at the moment the dirty bitmap
is constructed based on the VAs in the linked list. If the PTE frobbing
happens
immediately before add_mapped_vaddr, the corresponding dirty-page would be 
checked at the next round get-dirty-gitmap. 

Now, I start thinking of using bitmap rather than linked list, and I think
it
is similar there. The critical section would be the one that writes into the
bitmap and the one that reads the bitmap (copy to the bitmap from
toolstack).

Jaeyong


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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