Displaying 20 results from an estimated 64 matches for "clear_pending_set_locked".
2014 Jun 18
2
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
Il 15/06/2014 14:47, Peter Zijlstra ha scritto:
>
> - for (;;) {
> - new = (val & ~_Q_PENDING_MASK) | _Q_LOCKED_VAL;
> -
> - old = atomic_cmpxchg(&lock->val, val, new);
> - if (old == val)
> - break;
> -
> - val = old;
> - }
> + clear_pending_set_locked(lock, val);
> return;
Might as well add clear_pending_set_locked already in patch 3.
Paolo
2014 Jun 18
2
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
Il 15/06/2014 14:47, Peter Zijlstra ha scritto:
>
> - for (;;) {
> - new = (val & ~_Q_PENDING_MASK) | _Q_LOCKED_VAL;
> -
> - old = atomic_cmpxchg(&lock->val, val, new);
> - if (old == val)
> - break;
> -
> - val = old;
> - }
> + clear_pending_set_locked(lock, val);
> return;
Might as well add clear_pending_set_locked already in patch 3.
Paolo
2014 Jul 07
2
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...t;> - for (;;) {
>>> - new = (val & ~_Q_PENDING_MASK) | _Q_LOCKED_VAL;
>>> -
>>> - old = atomic_cmpxchg(&lock->val, val, new);
>>> - if (old == val)
>>> - break;
>>> -
>>> - val = old;
>>> - }
>>> + clear_pending_set_locked(lock, val);
>>> return;
>>
>>
>> Might as well add clear_pending_set_locked already in patch 3.
>
> Patch 4, if anywhere.
>
This code is added in patch 3:
+ /*
+ * take ownership and clear the pending bit.
+ *
+ * *,1,0 -> *,0,1
+ */
+ for (;;) {
+ new...
2014 Jul 07
2
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...t;> - for (;;) {
>>> - new = (val & ~_Q_PENDING_MASK) | _Q_LOCKED_VAL;
>>> -
>>> - old = atomic_cmpxchg(&lock->val, val, new);
>>> - if (old == val)
>>> - break;
>>> -
>>> - val = old;
>>> - }
>>> + clear_pending_set_locked(lock, val);
>>> return;
>>
>>
>> Might as well add clear_pending_set_locked already in patch 3.
>
> Patch 4, if anywhere.
>
This code is added in patch 3:
+ /*
+ * take ownership and clear the pending bit.
+ *
+ * *,1,0 -> *,0,1
+ */
+ for (;;) {
+ new...
2014 Apr 17
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...Long wrote:
> +struct __qspinlock {
> + union {
> + atomic_t val;
> + struct {
> +#ifdef __LITTLE_ENDIAN
> + u16 locked_pending;
> + u16 tail;
> +#else
> + u16 tail;
> + u16 locked_pending;
> +#endif
> + };
> + };
> +};
> +
> +/**
> + * clear_pending_set_locked - take ownership and clear the pending bit.
> + * @lock: Pointer to queue spinlock structure
> + * @val : Current value of the queue spinlock 32-bit word
> + *
> + * *,1,0 -> *,0,1
> + */
> +static __always_inline void
> +clear_pending_set_locked(struct qspinlock *lock, u32...
2014 Apr 17
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...Long wrote:
> +struct __qspinlock {
> + union {
> + atomic_t val;
> + struct {
> +#ifdef __LITTLE_ENDIAN
> + u16 locked_pending;
> + u16 tail;
> +#else
> + u16 tail;
> + u16 locked_pending;
> +#endif
> + };
> + };
> +};
> +
> +/**
> + * clear_pending_set_locked - take ownership and clear the pending bit.
> + * @lock: Pointer to queue spinlock structure
> + * @val : Current value of the queue spinlock 32-bit word
> + *
> + * *,1,0 -> *,0,1
> + */
> +static __always_inline void
> +clear_pending_set_locked(struct qspinlock *lock, u32...
2014 Jun 18
1
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...== 8
> +
> +struct __qspinlock {
> + union {
> + atomic_t val;
> + struct {
> +#ifdef __LITTLE_ENDIAN
> + u16 locked_pending;
> + u16 tail;
> +#else
> + u16 tail;
> + u16 locked_pending;
> +#endif
> + };
> + };
> +};
> +
> +/**
> + * clear_pending_set_locked - take ownership and clear the pending bit.
> + * @lock: Pointer to queue spinlock structure
> + * @val : Current value of the queue spinlock 32-bit word
> + *
> + * *,1,0 -> *,0,1
> + *
> + * Lock stealing is not allowed if this function is used.
> + */
> +static __alway...
2014 Jun 18
1
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...== 8
> +
> +struct __qspinlock {
> + union {
> + atomic_t val;
> + struct {
> +#ifdef __LITTLE_ENDIAN
> + u16 locked_pending;
> + u16 tail;
> +#else
> + u16 tail;
> + u16 locked_pending;
> +#endif
> + };
> + };
> +};
> +
> +/**
> + * clear_pending_set_locked - take ownership and clear the pending bit.
> + * @lock: Pointer to queue spinlock structure
> + * @val : Current value of the queue spinlock 32-bit word
> + *
> + * *,1,0 -> *,0,1
> + *
> + * Lock stealing is not allowed if this function is used.
> + */
> +static __alway...
2014 Jun 15
0
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...mization of the lock acquisition for the pending
+ * bit holder.
+ */
+#if _Q_PENDING_BITS == 8
+
+struct __qspinlock {
+ union {
+ atomic_t val;
+ struct {
+#ifdef __LITTLE_ENDIAN
+ u16 locked_pending;
+ u16 tail;
+#else
+ u16 tail;
+ u16 locked_pending;
+#endif
+ };
+ };
+};
+
+/**
+ * clear_pending_set_locked - take ownership and clear the pending bit.
+ * @lock: Pointer to queue spinlock structure
+ * @val : Current value of the queue spinlock 32-bit word
+ *
+ * *,1,0 -> *,0,1
+ *
+ * Lock stealing is not allowed if this function is used.
+ */
+static __always_inline void
+clear_pending_set_locked(...
2014 Apr 17
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...mization of the lock acquisition for the pending
+ * bit holder.
+ */
+#if _Q_PENDING_BITS == 8
+
+struct __qspinlock {
+ union {
+ atomic_t val;
+ struct {
+#ifdef __LITTLE_ENDIAN
+ u16 locked_pending;
+ u16 tail;
+#else
+ u16 tail;
+ u16 locked_pending;
+#endif
+ };
+ };
+};
+
+/**
+ * clear_pending_set_locked - take ownership and clear the pending bit.
+ * @lock: Pointer to queue spinlock structure
+ * @val : Current value of the queue spinlock 32-bit word
+ *
+ * *,1,0 -> *,0,1
+ */
+static __always_inline void
+clear_pending_set_locked(struct qspinlock *lock, u32 val)
+{
+ struct __qspinlock *l = (...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...>>+#else
> >>+ u16 tail;
> >>+ u16 locked_pending;
> >>+#endif
> >>+ };
struct {
#ifdef __LITTLE_ENDIAN
u8 locked;
#else
u8 res[3];
u8 locked;
#endif
};
> >>+ };
> >>+};
> >>+
> >>+/**
> >>+ * clear_pending_set_locked - take ownership and clear the pending bit.
> >>+ * @lock: Pointer to queue spinlock structure
> >>+ * @val : Current value of the queue spinlock 32-bit word
> >>+ *
> >>+ * *,1,0 -> *,0,1
> >>+ */
> >>+static __always_inline void
> >&...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...>>+#else
> >>+ u16 tail;
> >>+ u16 locked_pending;
> >>+#endif
> >>+ };
struct {
#ifdef __LITTLE_ENDIAN
u8 locked;
#else
u8 res[3];
u8 locked;
#endif
};
> >>+ };
> >>+};
> >>+
> >>+/**
> >>+ * clear_pending_set_locked - take ownership and clear the pending bit.
> >>+ * @lock: Pointer to queue spinlock structure
> >>+ * @val : Current value of the queue spinlock 32-bit word
> >>+ *
> >>+ * *,1,0 -> *,0,1
> >>+ */
> >>+static __always_inline void
> >&...
2014 Apr 17
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +static __always_inline void
> +clear_pending_set_locked(struct qspinlock *lock, u32 val)
> +{
> + struct __qspinlock *l = (void *)lock;
> +
> + ACCESS_ONCE(l->locked_pending) = 1;
> +}
> @@ -157,8 +251,13 @@ static inline int trylock_pending(struct qspinlock *lock, u32 *pval)
> * we're pending, wait for the owner to go aw...
2014 Jul 07
0
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...;- new = (val & ~_Q_PENDING_MASK) | _Q_LOCKED_VAL;
> >>>-
> >>>- old = atomic_cmpxchg(&lock->val, val, new);
> >>>- if (old == val)
> >>>- break;
> >>>-
> >>>- val = old;
> >>>- }
> >>>+ clear_pending_set_locked(lock, val);
> >>> return;
> >>
> >>
> >>Might as well add clear_pending_set_locked already in patch 3.
> >
> >Patch 4, if anywhere.
> >
>
> This code is added in patch 3:
>
> + /*
> + * take ownership and clear the pending b...
2014 Apr 17
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +static __always_inline void
> +clear_pending_set_locked(struct qspinlock *lock, u32 val)
> +{
> + struct __qspinlock *l = (void *)lock;
> +
> + ACCESS_ONCE(l->locked_pending) = 1;
> +}
> @@ -157,8 +251,13 @@ static inline int trylock_pending(struct qspinlock *lock, u32 *pval)
> * we're pending, wait for the owner to go aw...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
* Waiman Long <waiman.long at hp.com> wrote:
> On 04/17/2014 11:58 AM, Peter Zijlstra wrote:
> >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> >>+static __always_inline void
> >>+clear_pending_set_locked(struct qspinlock *lock, u32 val)
> >>+{
> >>+ struct __qspinlock *l = (void *)lock;
> >>+
> >>+ ACCESS_ONCE(l->locked_pending) = 1;
> >>+}
> >>@@ -157,8 +251,13 @@ static inline int trylock_pending(struct qspinlock *lock, u32 *pval)
> >...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
* Waiman Long <waiman.long at hp.com> wrote:
> On 04/17/2014 11:58 AM, Peter Zijlstra wrote:
> >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> >>+static __always_inline void
> >>+clear_pending_set_locked(struct qspinlock *lock, u32 val)
> >>+{
> >>+ struct __qspinlock *l = (void *)lock;
> >>+
> >>+ ACCESS_ONCE(l->locked_pending) = 1;
> >>+}
> >>@@ -157,8 +251,13 @@ static inline int trylock_pending(struct qspinlock *lock, u32 *pval)
> >...
2014 Apr 17
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...gt; + atomic_t val;
>> + struct {
>> +#ifdef __LITTLE_ENDIAN
>> + u16 locked_pending;
>> + u16 tail;
>> +#else
>> + u16 tail;
>> + u16 locked_pending;
>> +#endif
>> + };
>> + };
>> +};
>> +
>> +/**
>> + * clear_pending_set_locked - take ownership and clear the pending bit.
>> + * @lock: Pointer to queue spinlock structure
>> + * @val : Current value of the queue spinlock 32-bit word
>> + *
>> + * *,1,0 -> *,0,1
>> + */
>> +static __always_inline void
>> +clear_pending_set_locked...
2014 Apr 18
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...ending;
>>>> +#endif
>>>> + };
> struct {
> #ifdef __LITTLE_ENDIAN
> u8 locked;
> #else
> u8 res[3];
> u8 locked;
> #endif
> };
>
>>>> + };
>>>> +};
>>>> +
>>>> +/**
>>>> + * clear_pending_set_locked - take ownership and clear the pending bit.
>>>> + * @lock: Pointer to queue spinlock structure
>>>> + * @val : Current value of the queue spinlock 32-bit word
>>>> + *
>>>> + * *,1,0 -> *,0,1
>>>> + */
>>>> +static __alwa...
2014 Jul 07
0
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...er Zijlstra ha scritto:
> >
> >- for (;;) {
> >- new = (val & ~_Q_PENDING_MASK) | _Q_LOCKED_VAL;
> >-
> >- old = atomic_cmpxchg(&lock->val, val, new);
> >- if (old == val)
> >- break;
> >-
> >- val = old;
> >- }
> >+ clear_pending_set_locked(lock, val);
> > return;
>
>
> Might as well add clear_pending_set_locked already in patch 3.
Patch 4, if anywhere.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available...