Displaying 12 results from an estimated 12 matches for "tickets_equal".
Did you mean:
__tickets_equal
2015 Feb 11
1
[PATCH] x86 spinlock: Fix memory corruption on completing completions
...lock() could simply do
head = xadd(&lock->tickets.head, TICKET_LOCK_INC);
if (head & TICKET_SLOWPATH_FLAG)
__ticket_unlock_kick(head);
so it can't overflow to .tail?
But probably I missed your concern.
And we we do this, probably it makes sense to add something like
bool tickets_equal(__ticket_t one, __ticket_t two)
{
return (one ^ two) & ~TICKET_SLOWPATH_FLAG;
}
and change kvm_lock_spinning() to use tickets_equal(tickets.head, want), plus
it can have more users in asm/spinlock.h.
Oleg.
2015 Feb 11
1
[PATCH] x86 spinlock: Fix memory corruption on completing completions
...lock() could simply do
head = xadd(&lock->tickets.head, TICKET_LOCK_INC);
if (head & TICKET_SLOWPATH_FLAG)
__ticket_unlock_kick(head);
so it can't overflow to .tail?
But probably I missed your concern.
And we we do this, probably it makes sense to add something like
bool tickets_equal(__ticket_t one, __ticket_t two)
{
return (one ^ two) & ~TICKET_SLOWPATH_FLAG;
}
and change kvm_lock_spinning() to use tickets_equal(tickets.head, want), plus
it can have more users in asm/spinlock.h.
Oleg.
2015 Feb 10
4
[PATCH] x86 spinlock: Fix memory corruption on completing completions
On 02/10, Raghavendra K T wrote:
>
> On 02/10/2015 06:23 AM, Linus Torvalds wrote:
>
>> add_smp(&lock->tickets.head, TICKET_LOCK_INC);
>> if (READ_ONCE(lock->tickets.tail) & TICKET_SLOWPATH_FLAG) ..
>>
>> into something like
>>
>> val = xadd((&lock->ticket.head_tail, TICKET_LOCK_INC << TICKET_SHIFT);
2015 Feb 10
4
[PATCH] x86 spinlock: Fix memory corruption on completing completions
On 02/10, Raghavendra K T wrote:
>
> On 02/10/2015 06:23 AM, Linus Torvalds wrote:
>
>> add_smp(&lock->tickets.head, TICKET_LOCK_INC);
>> if (READ_ONCE(lock->tickets.tail) & TICKET_SLOWPATH_FLAG) ..
>>
>> into something like
>>
>> val = xadd((&lock->ticket.head_tail, TICKET_LOCK_INC << TICKET_SHIFT);
2015 Feb 15
1
[PATCH V4] x86 spinlock: Fix memory corruption on completing completions
...int arch_spin_is_locked(arch_spinlock_t *lock)
>> {
>> struct __raw_tickets tmp = READ_ONCE(lock->tickets);
>>
>> - return tmp.tail != tmp.head;
>> + return tmp.tail != (tmp.head & ~TICKET_SLOWPATH_FLAG);
>> }
>
> Well, this can probably use __tickets_equal() too. But this is cosmetic.
That looks good. Added.
> It seems that arch_spin_is_contended() should be fixed with this change,
>
> (__ticket_t)(tmp.tail - tmp.head) > TICKET_LOCK_INC
>
> can be true because of TICKET_SLOWPATH_FLAG in .head, even if it is actually
> unlocked...
2015 Feb 15
1
[PATCH V4] x86 spinlock: Fix memory corruption on completing completions
...int arch_spin_is_locked(arch_spinlock_t *lock)
>> {
>> struct __raw_tickets tmp = READ_ONCE(lock->tickets);
>>
>> - return tmp.tail != tmp.head;
>> + return tmp.tail != (tmp.head & ~TICKET_SLOWPATH_FLAG);
>> }
>
> Well, this can probably use __tickets_equal() too. But this is cosmetic.
That looks good. Added.
> It seems that arch_spin_is_contended() should be fixed with this change,
>
> (__ticket_t)(tmp.tail - tmp.head) > TICKET_LOCK_INC
>
> can be true because of TICKET_SLOWPATH_FLAG in .head, even if it is actually
> unlocked...
2015 Feb 15
0
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
...rnel/kvm.c | 10 +++--
arch/x86/xen/spinlock.c | 10 +++--
3 files changed, 59 insertions(+), 56 deletions(-)
potential TODO:
* The whole patch be splitted into, 1. move slowpath flag
2. fix memory corruption in completion problem ??
Changes since V4:
- one more usage of tickets_equal() (Oleg)
- head > tail situation can lead to false contended check (Oleg)
- smp_mb__after_atomic() added after slowptha_enter (Oleg)
Changes since V3:
- Detailed changelog (PeterZ)
- Replace ACCESS_ONCE with READ_ONCE (oleg)
- Add xen changes (Oleg)
- Correct break logic in unlock_w...
2015 Feb 15
0
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
...rnel/kvm.c | 10 +++--
arch/x86/xen/spinlock.c | 10 +++--
3 files changed, 59 insertions(+), 56 deletions(-)
potential TODO:
* The whole patch be splitted into, 1. move slowpath flag
2. fix memory corruption in completion problem ??
Changes since V4:
- one more usage of tickets_equal() (Oleg)
- head > tail situation can lead to false contended check (Oleg)
- smp_mb__after_atomic() added after slowptha_enter (Oleg)
Changes since V3:
- Detailed changelog (PeterZ)
- Replace ACCESS_ONCE with READ_ONCE (oleg)
- Add xen changes (Oleg)
- Correct break logic in unlock_w...
2015 Feb 15
7
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
...rnel/kvm.c | 10 +++--
arch/x86/xen/spinlock.c | 10 +++--
3 files changed, 59 insertions(+), 56 deletions(-)
potential TODO:
* The whole patch be splitted into, 1. move slowpath flag
2. fix memory corruption in completion problem ??
Changes since V4:
- one more usage of tickets_equal() (Oleg)
- head > tail situation can lead to false contended check (Oleg)
Changes since V3:
- Detailed changelog (PeterZ)
- Replace ACCESS_ONCE with READ_ONCE (oleg)
- Add xen changes (Oleg)
- Correct break logic in unlock_wait() (Oleg)
Changes since V2:
- Move the slowpath flag to...
2015 Feb 15
7
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
...rnel/kvm.c | 10 +++--
arch/x86/xen/spinlock.c | 10 +++--
3 files changed, 59 insertions(+), 56 deletions(-)
potential TODO:
* The whole patch be splitted into, 1. move slowpath flag
2. fix memory corruption in completion problem ??
Changes since V4:
- one more usage of tickets_equal() (Oleg)
- head > tail situation can lead to false contended check (Oleg)
Changes since V3:
- Detailed changelog (PeterZ)
- Replace ACCESS_ONCE with READ_ONCE (oleg)
- Add xen changes (Oleg)
- Correct break logic in unlock_wait() (Oleg)
Changes since V2:
- Move the slowpath flag to...
2015 Feb 24
2
[PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock
...7 ++-
arch/x86/xen/spinlock.c | 7 ++-
3 files changed, 58 insertions(+), 50 deletions(-)
Changes for stable:
- Don't replace the ACCESS_ONCE to READ_ONCE which would cause horraneous
Compiler warnings (Linus, David Vbriel, PeterZ, Ingo)
Changes since V4:
- one more usage of tickets_equal() (Oleg)
- head > tail situation can lead to false contended check (Oleg)
- smp_mb__after_atomic() added after slowptha_enter (Oleg)
Changes since V3:
- Detailed changelog (PeterZ)
- Replace ACCESS_ONCE with READ_ONCE (oleg)
- Add xen changes (Oleg)
- Correct break logic in unlock_w...
2015 Feb 24
2
[PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock
...7 ++-
arch/x86/xen/spinlock.c | 7 ++-
3 files changed, 58 insertions(+), 50 deletions(-)
Changes for stable:
- Don't replace the ACCESS_ONCE to READ_ONCE which would cause horraneous
Compiler warnings (Linus, David Vbriel, PeterZ, Ingo)
Changes since V4:
- one more usage of tickets_equal() (Oleg)
- head > tail situation can lead to false contended check (Oleg)
- smp_mb__after_atomic() added after slowptha_enter (Oleg)
Changes since V3:
- Detailed changelog (PeterZ)
- Replace ACCESS_ONCE with READ_ONCE (oleg)
- Add xen changes (Oleg)
- Correct break logic in unlock_w...