search for: tail_inc

Displaying 5 results from an estimated 5 matches for "tail_inc".

Did you mean: tail_idx
2014 May 29
0
[RFC] Implement Batched (group) ticket lock
...ic __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
7
[RFC] Implement Batched (group) ticket lock
...k.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
...k.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 Jun 28
2
[RFC PATCH v2] Implement Batched (group) ticket lock
.... - Change TICKET_LOCK_INC_SHIFT back to 0 in !CONFIG_PARAVIRT case (Rik). - Add build check to make sure TICKET_BATCH is power of 2 (Rik). - Replace extra cmpxchg with add_smp for CONFIG_PARAVIRT enabled case in host (Waiman, Linus.. had concernes). - Correct TICKET_LOCK_BATCH_MASK to suit all TAIL_INC (expression given by Waiman). - Add comment on LOCK bit (Waiman). - Add Xen support (Completely untested). TODO: (But none of the below imply shortcoming of current patch) - we can further add dynamically changing batch_size (to 1 and MAX size) implementation (inspiration and hint by Paul McK...
2014 Jun 28
2
[RFC PATCH v2] Implement Batched (group) ticket lock
.... - Change TICKET_LOCK_INC_SHIFT back to 0 in !CONFIG_PARAVIRT case (Rik). - Add build check to make sure TICKET_BATCH is power of 2 (Rik). - Replace extra cmpxchg with add_smp for CONFIG_PARAVIRT enabled case in host (Waiman, Linus.. had concernes). - Correct TICKET_LOCK_BATCH_MASK to suit all TAIL_INC (expression given by Waiman). - Add comment on LOCK bit (Waiman). - Add Xen support (Completely untested). TODO: (But none of the below imply shortcoming of current patch) - we can further add dynamically changing batch_size (to 1 and MAX size) implementation (inspiration and hint by Paul McK...