All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, David Vrabel <david.vrabel@citrix.com>
Cc: Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jennifer Herbert <jennifer.herbert@citrix.com>,
	Tim Deegan <tim@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCHv4 5/8] xen: use ticket locks for spin locks
Date: Mon, 11 May 2015 14:13:49 +0100	[thread overview]
Message-ID: <5550AB0D.8050809@citrix.com> (raw)
In-Reply-To: <554C9FB60200007800078181@mail.emea.novell.com>

On 08/05/15 10:36, Jan Beulich wrote:
>>
>> +        }
>> +    }
>>      smp_mb();
>>  }
> 
> The old code had smp_mb() before _and_ after the check - is it really
> correct to drop the one before (or effectively replace it by smp_rmb()
> in observe_{lock,head}())?

Typical usage is:

    d->is_dying = DOMDYING_dying;
    spin_barrier(&d->domain_lock);

So there needs to be a barrier before we check that the lock is
released.  i.e., I removed the wrong smp_mb().

I don't see the need for the second barrier since there's no stores in
_spin_barrier() and observe_lock() and observe_head() both have their
required read barriers.

David

  reply	other threads:[~2015-05-11 13:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 15:33 [PATCHv4 0/8] Use ticket locks for spinlocks David Vrabel
2015-04-30 15:33 ` [PATCHv4 1/8] x86: provide arch_fetch_and_add() David Vrabel
2015-05-07 15:59   ` Jan Beulich
2015-04-30 15:33 ` [PATCHv4 2/8] arm: " David Vrabel
2015-04-30 15:33 ` [PATCHv4 3/8] x86: provide add_sized() David Vrabel
2015-05-07 16:05   ` Jan Beulich
2015-04-30 15:33 ` [PATCHv4 4/8] arm: " David Vrabel
2015-05-05 13:49   ` Ian Campbell
2015-05-05 13:54     ` Tim Deegan
2015-04-30 15:33 ` [PATCHv4 5/8] xen: use ticket locks for spin locks David Vrabel
2015-05-05 13:56   ` Ian Campbell
2015-05-05 13:58     ` David Vrabel
2015-05-08  9:36   ` Jan Beulich
2015-05-11 13:13     ` David Vrabel [this message]
2015-05-11 13:29       ` Tim Deegan
2015-04-30 15:33 ` [PATCHv4 6/8] x86, arm: remove asm/spinlock.h from all architectures David Vrabel
2015-05-05 13:49   ` Ian Campbell
2015-04-30 15:33 ` [PATCHv4 7/8] x86: reduce struct paging_domain size David Vrabel
2015-04-30 15:33 ` [PATCHv4 8/8] x86: reduce struct hvm_domain size David Vrabel
2015-05-08  9:47   ` Jan Beulich
2015-05-11 13:17     ` David Vrabel

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=5550AB0D.8050809@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jennifer.herbert@citrix.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.