search for: q_locked_val

Displaying 14 results from an estimated 14 matches for "q_locked_val".

Did you mean: _q_locked_val
2014 Jun 17
5
[PATCH 03/11] qspinlock: Add pending bit
...eneric/qspinlock.h +++ b/include/asm-generic/qspinlock.h @@ -75,11 +75,21 @@ extern void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val); */ static __always_inline void queue_spin_lock(struct qspinlock *lock) { - u32 val; + u32 val, new; val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); if (likely(val == 0)) return; + + /* One more attempt - but if we fail mark it as pending. */ + if (val == _Q_LOCKED_VAL) { + new = Q_LOCKED_VAL |_Q_PENDING_VAL; + + old = atomic_cmpxchg(&lock->val, val, new); + if (old == _Q_LOCKED_VAL) /* YEEY! */ + return; + val = old; + }...
2014 Jun 17
5
[PATCH 03/11] qspinlock: Add pending bit
...eneric/qspinlock.h +++ b/include/asm-generic/qspinlock.h @@ -75,11 +75,21 @@ extern void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val); */ static __always_inline void queue_spin_lock(struct qspinlock *lock) { - u32 val; + u32 val, new; val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); if (likely(val == 0)) return; + + /* One more attempt - but if we fail mark it as pending. */ + if (val == _Q_LOCKED_VAL) { + new = Q_LOCKED_VAL |_Q_PENDING_VAL; + + old = atomic_cmpxchg(&lock->val, val, new); + if (old == _Q_LOCKED_VAL) /* YEEY! */ + return; + val = old; + }...
2014 Jun 17
3
[PATCH 03/11] qspinlock: Add pending bit
...+75,21 @@ extern void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val); > > */ > > static __always_inline void queue_spin_lock(struct qspinlock *lock) > > { > >- u32 val; > >+ u32 val, new; > > > > val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); > > if (likely(val == 0)) > > return; > >+ > >+ /* One more attempt - but if we fail mark it as pending. */ > >+ if (val == _Q_LOCKED_VAL) { > >+ new = Q_LOCKED_VAL |_Q_PENDING_VAL; > >+ > >+ old = atomic_cmpxchg(&lock->val, val, new);...
2014 Jun 17
3
[PATCH 03/11] qspinlock: Add pending bit
...+75,21 @@ extern void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val); > > */ > > static __always_inline void queue_spin_lock(struct qspinlock *lock) > > { > >- u32 val; > >+ u32 val, new; > > > > val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); > > if (likely(val == 0)) > > return; > >+ > >+ /* One more attempt - but if we fail mark it as pending. */ > >+ if (val == _Q_LOCKED_VAL) { > >+ new = Q_LOCKED_VAL |_Q_PENDING_VAL; > >+ > >+ old = atomic_cmpxchg(&lock->val, val, new);...
2014 Jun 17
0
[PATCH 03/11] qspinlock: Add pending bit
...ic/qspinlock.h > @@ -75,11 +75,21 @@ extern void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val); > */ > static __always_inline void queue_spin_lock(struct qspinlock *lock) > { > - u32 val; > + u32 val, new; > > val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); > if (likely(val == 0)) > return; > + > + /* One more attempt - but if we fail mark it as pending. */ > + if (val == _Q_LOCKED_VAL) { > + new = Q_LOCKED_VAL |_Q_PENDING_VAL; > + > + old = atomic_cmpxchg(&lock->val, val, new); > + if (old == _Q_LOCKED_VA...
2014 Jun 18
0
[PATCH 03/11] qspinlock: Add pending bit
Il 17/06/2014 22:36, Konrad Rzeszutek Wilk ha scritto: > + /* One more attempt - but if we fail mark it as pending. */ > + if (val == _Q_LOCKED_VAL) { > + new = Q_LOCKED_VAL |_Q_PENDING_VAL; > + > + old = atomic_cmpxchg(&lock->val, val, new); > + if (old == _Q_LOCKED_VAL) /* YEEY! */ > + return; > + val = old; > + } Note that Peter's code is in a for(;;) loop: + for (;;) { + /* + * If we observe any...
2014 Jun 17
0
[PATCH 03/11] qspinlock: Add pending bit
...ock_slowpath(struct qspinlock *lock, u32 val); > > > */ > > > static __always_inline void queue_spin_lock(struct qspinlock *lock) > > > { > > >- u32 val; > > >+ u32 val, new; > > > > > > val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); > > > if (likely(val == 0)) > > > return; > > >+ > > >+ /* One more attempt - but if we fail mark it as pending. */ > > >+ if (val == _Q_LOCKED_VAL) { > > >+ new = Q_LOCKED_VAL |_Q_PENDING_VAL; > > >+ > > >+ old = atom...
2014 Jun 16
4
[PATCH 01/11] qspinlock: A simple generic 4-byte queue spinlock
...to) I presume what you mean is that if we are the next after the lock-holder we need only to update the 'next' (or the composite value of smp_processor_idx | idx) to point to us. As in, swap the 'L' with 'I' (looking at the doc) > + */ > + for (;;) { > + new = _Q_LOCKED_VAL; > + if (val) Could you add a comment here, like this: /* * N.B. Initially 'val' will have some value (as we are called * after the _Q_LOCKED_VAL could not be set by queue_spin_lock). * But on subsequent iterations, either the lock holder will * decrement the val (queue_spin_unloc...
2014 Jun 16
4
[PATCH 01/11] qspinlock: A simple generic 4-byte queue spinlock
...to) I presume what you mean is that if we are the next after the lock-holder we need only to update the 'next' (or the composite value of smp_processor_idx | idx) to point to us. As in, swap the 'L' with 'I' (looking at the doc) > + */ > + for (;;) { > + new = _Q_LOCKED_VAL; > + if (val) Could you add a comment here, like this: /* * N.B. Initially 'val' will have some value (as we are called * after the _Q_LOCKED_VAL could not be set by queue_spin_lock). * But on subsequent iterations, either the lock holder will * decrement the val (queue_spin_unloc...
2014 Jun 17
1
[PATCH 03/11] qspinlock: Add pending bit
...>>??? */ > >>>>?? static __always_inline void queue_spin_lock(struct qspinlock *lock) > >>>>?? { > >>>> - u32 val; > >>>> + u32 val, new; > >>>> > >>>>?? val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); > >>>>?? if (likely(val == 0)) > >>>>?? return; > >>>> + > >>>> + /* One more attempt - but if we fail mark it as pending. */ > >>>> + if (val == _Q_LOCKED_VAL) { > >>>> + new = Q_LOCKED_VAL |_Q_PENDIN...
2014 Jun 17
1
[PATCH 03/11] qspinlock: Add pending bit
...>>??? */ > >>>>?? static __always_inline void queue_spin_lock(struct qspinlock *lock) > >>>>?? { > >>>> - u32 val; > >>>> + u32 val, new; > >>>> > >>>>?? val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL); > >>>>?? if (likely(val == 0)) > >>>>?? return; > >>>> + > >>>> + /* One more attempt - but if we fail mark it as pending. */ > >>>> + if (val == _Q_LOCKED_VAL) { > >>>> + new = Q_LOCKED_VAL |_Q_PENDIN...
2014 Jun 23
0
[PATCH 01/11] qspinlock: A simple generic 4-byte queue spinlock
...the 'tail','lock' tuples, so this composite atomic operation completes either: 0,0 -> 0,1 -- we had no tail, not locked; into: no tail, locked. OR p,x -> n,x -- tail was p; into: tail is n; preserving locked. > > + */ > > + for (;;) { > > + new = _Q_LOCKED_VAL; > > + if (val) > > Could you add a comment here, like this: > > /* > * N.B. Initially 'val' will have some value (as we are called > * after the _Q_LOCKED_VAL could not be set by queue_spin_lock). > * But on subsequent iterations, either the lock holder wil...
2014 Jun 15
28
[PATCH 00/11] qspinlock with paravirt support
Since Waiman seems incapable of doing simple things; here's my take on the paravirt crap. The first few patches are taken from Waiman's latest series, but the virt support is completely new. Its primary aim is to not mess up the native code. I've not stress tested it, but the virt and paravirt (kvm) cases boot on simple smp guests. I've not done Xen, but the patch should be
2014 Jun 15
28
[PATCH 00/11] qspinlock with paravirt support
Since Waiman seems incapable of doing simple things; here's my take on the paravirt crap. The first few patches are taken from Waiman's latest series, but the virt support is completely new. Its primary aim is to not mess up the native code. I've not stress tested it, but the virt and paravirt (kvm) cases boot on simple smp guests. I've not done Xen, but the patch should be