search for: ticket_lock_tail_inc

Displaying 6 results from an estimated 6 matches for "ticket_lock_tail_inc".

2014 May 28
7
[RFC] Implement Batched (group) ticket lock
.../asm/spinlock.h @@ -81,23 +81,36 @@ static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) */ static __always_inline void arch_spin_lock(arch_spinlock_t *lock) { - register struct __raw_tickets inc = { .tail = TICKET_LOCK_INC }; + register struct __raw_tickets inc = { .tail = TICKET_LOCK_TAIL_INC }; + struct __raw_tickets new; inc = xadd(&lock->tickets, inc); - if (likely(inc.head == inc.tail)) - goto out; inc.tail &= ~TICKET_SLOWPATH_FLAG; for (;;) { unsigned count = SPIN_THRESHOLD; do { - if (ACCESS_ONCE(lock->tickets.head) == inc.tail) - goto out; +...
2014 May 28
7
[RFC] Implement Batched (group) ticket lock
.../asm/spinlock.h @@ -81,23 +81,36 @@ static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) */ static __always_inline void arch_spin_lock(arch_spinlock_t *lock) { - register struct __raw_tickets inc = { .tail = TICKET_LOCK_INC }; + register struct __raw_tickets inc = { .tail = TICKET_LOCK_TAIL_INC }; + struct __raw_tickets new; inc = xadd(&lock->tickets, inc); - if (likely(inc.head == inc.tail)) - goto out; inc.tail &= ~TICKET_SLOWPATH_FLAG; for (;;) { unsigned count = SPIN_THRESHOLD; do { - if (ACCESS_ONCE(lock->tickets.head) == inc.tail) - goto out; +...
2014 May 29
0
[RFC] Implement Batched (group) ticket lock
...1,36 @@ static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) > */ > static __always_inline void arch_spin_lock(arch_spinlock_t *lock) > { > - register struct __raw_tickets inc = { .tail = TICKET_LOCK_INC }; > + register struct __raw_tickets inc = { .tail = TICKET_LOCK_TAIL_INC }; > + struct __raw_tickets new; > > inc = xadd(&lock->tickets, inc); > - if (likely(inc.head == inc.tail)) > - goto out; > > inc.tail&= ~TICKET_SLOWPATH_FLAG; > for (;;) { > unsigned count = SPIN_THRESHOLD; > > do { > - if (ACCESS_...
2014 May 28
0
[RFC] Implement Batched (group) ticket lock
.../arch/x86/include/asm/spinlock_types.h > index 4f1bea1..b04c03d 100644 > --- a/arch/x86/include/asm/spinlock_types.h > +++ b/arch/x86/include/asm/spinlock_types.h > @@ -3,15 +3,16 @@ > > #include <linux/types.h> > > +#define TICKET_LOCK_INC_SHIFT 1 > +#define __TICKET_LOCK_TAIL_INC (1<<TICKET_LOCK_INC_SHIFT) > + > #ifdef CONFIG_PARAVIRT_SPINLOCKS > -#define __TICKET_LOCK_INC 2 > #define TICKET_SLOWPATH_FLAG ((__ticket_t)1) > #else > -#define __TICKET_LOCK_INC 1 > #define TICKET_SLOWPATH_FLAG ((__ticket_t)0) > #endif For the !CONFIG_PARAVIRT...
2014 Jun 28
2
[RFC PATCH v2] Implement Batched (group) ticket lock
...inlock_t lock) @@ -81,24 +121,28 @@ static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) */ static __always_inline void arch_spin_lock(arch_spinlock_t *lock) { - register struct __raw_tickets inc = { .tail = TICKET_LOCK_INC }; + register struct __raw_tickets inc = { .tail = TICKET_LOCK_TAIL_INC }; + check_sane_mask(); inc = xadd(&lock->tickets, inc); - if (likely(inc.head == inc.tail)) - goto out; inc.tail &= ~TICKET_SLOWPATH_FLAG; for (;;) { unsigned count = SPIN_THRESHOLD; + unsigned batchmask = __ticket_lock_get_batch_mask(); do { - if (ACCESS_ONCE(lock...
2014 Jun 28
2
[RFC PATCH v2] Implement Batched (group) ticket lock
...inlock_t lock) @@ -81,24 +121,28 @@ static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) */ static __always_inline void arch_spin_lock(arch_spinlock_t *lock) { - register struct __raw_tickets inc = { .tail = TICKET_LOCK_INC }; + register struct __raw_tickets inc = { .tail = TICKET_LOCK_TAIL_INC }; + check_sane_mask(); inc = xadd(&lock->tickets, inc); - if (likely(inc.head == inc.tail)) - goto out; inc.tail &= ~TICKET_SLOWPATH_FLAG; for (;;) { unsigned count = SPIN_THRESHOLD; + unsigned batchmask = __ticket_lock_get_batch_mask(); do { - if (ACCESS_ONCE(lock...