Re: [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-17 Thread Sasha Levin
On 02/15/2015 01:01 AM, Raghavendra K T wrote: On 02/15/2015 11:25 AM, Raghavendra K T wrote: Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(lock-tickets.head, TICKET_LOCK_INC);

Re: [Xen-devel] [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-17 Thread Raghavendra K T
On 02/16/2015 10:17 PM, David Vrabel wrote: On 15/02/15 17:30, Raghavendra K T wrote: --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -41,7 +41,7 @@ static u8 zero_stats; static inline void check_zero(void) { u8 ret; - u8 old = ACCESS_ONCE(zero_stats); +

Re: [Xen-devel] [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-16 Thread David Vrabel
On 15/02/15 17:30, Raghavendra K T wrote: --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -41,7 +41,7 @@ static u8 zero_stats; static inline void check_zero(void) { u8 ret; - u8 old = ACCESS_ONCE(zero_stats); + u8 old = READ_ONCE(zero_stats); if

Re: [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-15 Thread Oleg Nesterov
Well, I regret I mentioned the lack of barrier after enter_slowpath ;) On 02/15, Raghavendra K T wrote: @@ -46,7 +46,8 @@ static __always_inline bool static_key_false(struct static_key *key); static inline void __ticket_enter_slowpath(arch_spinlock_t *lock) { - set_bit(0, (volatile

Re: [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-15 Thread Raghavendra K T
: Fri, 6 Feb 2015 16:44:11 +0530 Subject: [PATCH RESEND V5] x86 spinlock: Fix memory corruption on completing completions Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(lock-tickets.head

Re: [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-15 Thread Raghavendra K T
On 02/15/2015 09:47 PM, Oleg Nesterov wrote: Well, I regret I mentioned the lack of barrier after enter_slowpath ;) On 02/15, Raghavendra K T wrote: @@ -46,7 +46,8 @@ static __always_inline bool static_key_false(struct static_key *key); static inline void

Re: [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-15 Thread Oleg Nesterov
On 02/15, Raghavendra K T wrote: * Raghavendra K T raghavendra...@linux.vnet.ibm.com [2015-02-15 11:25:44]: Resending the V5 with smp_mb__after_atomic() change without bumping up revision Reviewed-by: Oleg Nesterov o...@redhat.com Of course, this needs the acks from maintainers. And I

Re: [PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-14 Thread Raghavendra K T
On 02/15/2015 11:25 AM, Raghavendra K T wrote: Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(lock-tickets.head, TICKET_LOCK_INC); /* add_smp() is a full mb() */

[PATCH V5] x86 spinlock: Fix memory corruption on completing completions

2015-02-14 Thread Raghavendra K T
Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(lock-tickets.head, TICKET_LOCK_INC); /* add_smp() is a full mb() */ if (unlikely(lock-tickets.tail