All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>, xen-devel@lists.xensource.com
Subject: Re: barriers before {req/rsp}_cons = cons?
Date: Fri, 18 Jul 2008 20:34:45 +0100	[thread overview]
Message-ID: <20080718193445.GJ4576@implementation> (raw)
In-Reply-To: <20080718193304.GI4576@implementation>

Samuel Thibault, le Fri 18 Jul 2008 20:33:04 +0100, a écrit :
> 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,

(more precisely, the read, of course).

> and so another processor could try to reuse
> the same request slot.

Samuel

  reply	other threads:[~2008-07-18 19:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18 18:52 barriers before {req/rsp}_cons = cons? Samuel Thibault
2008-07-18 19:31 ` Keir Fraser
2008-07-18 19:33   ` Samuel Thibault
2008-07-18 19:34     ` Samuel Thibault [this message]
2008-07-21  8:28     ` Keir Fraser
2008-07-21 10:08       ` Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080718193445.GJ4576@implementation \
    --to=samuel.thibault@eu.citrix.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.