Skip to content

Commit

Permalink
x86/spinlock: Leftover conversion ACCESS_ONCE->READ_ONCE
Browse files Browse the repository at this point in the history
commit 78bff1c ("x86/ticketlock: Fix spin_unlock_wait() livelock")
introduced two additional ACCESS_ONCE cases in x86 spinlock.h.
Lets change those as well.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
  • Loading branch information
Christian Borntraeger committed Jan 19, 2015
1 parent 1760f1e commit bccec2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/include/asm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ static __always_inline void arch_spin_lock_flags(arch_spinlock_t *lock,

static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
{
__ticket_t head = ACCESS_ONCE(lock->tickets.head);
__ticket_t head = READ_ONCE(lock->tickets.head);

for (;;) {
struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
struct __raw_tickets tmp = READ_ONCE(lock->tickets);
/*
* We need to check "unlocked" in a loop, tmp.head == head
* can be false positive because of overflow.
Expand Down

0 comments on commit bccec2a

Please sign in to comment.