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

Re: [Xen-devel] barriers before {req/rsp}_cons = cons?



Keir Fraser, le Fri 18 Jul 2008 20:31:13 +0100, a écrit :
> > cons = netif->tx.req_cons;
> > rmb(); /* Ensure that we see the request before we copy it. */
> > memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
> > some checks
> > netif->tx.req_cons = ++cons;
> 
> Could you describe the race you believe is made possible by the absence of
> the barrier?

It is very unlikely, but the write into req_cons could happen before
actually doing the memcpy, and so another processor could try to reuse
the same request slot.

Samuel

_______________________________________________
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®.