search for: locked_pending

Displaying 20 results from an estimated 61 matches for "locked_pending".

2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...17/2014 11:56 AM, Peter Zijlstra wrote: > >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > >>+struct __qspinlock { > >>+ union { > >>+ atomic_t val; char bytes[4]; > >>+ struct { > >>+#ifdef __LITTLE_ENDIAN > >>+ u16 locked_pending; > >>+ u16 tail; > >>+#else > >>+ u16 tail; > >>+ u16 locked_pending; > >>+#endif > >>+ }; struct { #ifdef __LITTLE_ENDIAN u8 locked; #else u8 res[3]; u8 locked; #endif }; > >>+ }; > >>+}; > >>+ &...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...17/2014 11:56 AM, Peter Zijlstra wrote: > >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: > >>+struct __qspinlock { > >>+ union { > >>+ atomic_t val; char bytes[4]; > >>+ struct { > >>+#ifdef __LITTLE_ENDIAN > >>+ u16 locked_pending; > >>+ u16 tail; > >>+#else > >>+ u16 tail; > >>+ u16 locked_pending; > >>+#endif > >>+ }; struct { #ifdef __LITTLE_ENDIAN u8 locked; #else u8 res[3]; u8 locked; #endif }; > >>+ }; > >>+}; > >>+ &...
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: > +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...
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: > +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...
2014 Apr 18
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...te: >>> On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote: >>>> +struct __qspinlock { >>>> + union { >>>> + atomic_t val; > char bytes[4]; > >>>> + struct { >>>> +#ifdef __LITTLE_ENDIAN >>>> + u16 locked_pending; >>>> + u16 tail; >>>> +#else >>>> + u16 tail; >>>> + u16 locked_pending; >>>> +#endif >>>> + }; > struct { > #ifdef __LITTLE_ENDIAN > u8 locked; > #else > u8 res[3]; > u8 locked; > #endif...
2014 Apr 17
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On 04/17/2014 11:56 AM, Peter Zijlstra wrote: > On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman 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...
2020 Jul 24
3
[PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR
...ing back for >> it. >> >> Will, how do you feel about it? > I can see it potentially being useful for debugging, but I hate the > limitation to 256 CPUs. Even arm64 is hitting that now. After thinking more about that, I think we can use all the remaining bits in the 16-bit locked_pending. Reserving 1 bit for locked and 1 bit for pending, there are 14 bits left. So as long as NR_CPUS < 16k (requirement for 16-bit locked_pending), we can put all possible cpu numbers into the lock. We can also just use smp_processor_id() without additional percpu data. > > Also, you'...
2020 Jul 24
3
[PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR
...ing back for >> it. >> >> Will, how do you feel about it? > I can see it potentially being useful for debugging, but I hate the > limitation to 256 CPUs. Even arm64 is hitting that now. After thinking more about that, I think we can use all the remaining bits in the 16-bit locked_pending. Reserving 1 bit for locked and 1 bit for pending, there are 14 bits left. So as long as NR_CPUS < 16k (requirement for 16-bit locked_pending), we can put all possible cpu numbers into the lock. We can also just use smp_processor_id() without additional percpu data. > > Also, you'...
2014 May 08
1
[PATCH v10 07/19] qspinlock: Use a simple write to grab the lock, if applicable
...can allow better optimization of the lock acquisition for the pending > * bit holder. > */ > -#if _Q_PENDING_BITS == 8 > - > struct __qspinlock { > union { > atomic_t val; > - struct { > #ifdef __LITTLE_ENDIAN > + u8 locked; > + struct { > u16 locked_pending; > u16 tail; > + }; > #else > + struct { > u16 tail; > u16 locked_pending; > -#endif > }; > + struct { > + u8 reserved[3]; > + u8 locked; > + }; > +#endif > }; > }; > > +#if _Q_PENDING_BITS == 8 That doesn't make s...
2014 May 08
1
[PATCH v10 07/19] qspinlock: Use a simple write to grab the lock, if applicable
...can allow better optimization of the lock acquisition for the pending > * bit holder. > */ > -#if _Q_PENDING_BITS == 8 > - > struct __qspinlock { > union { > atomic_t val; > - struct { > #ifdef __LITTLE_ENDIAN > + u8 locked; > + struct { > u16 locked_pending; > u16 tail; > + }; > #else > + struct { > u16 tail; > u16 locked_pending; > -#endif > }; > + struct { > + u8 reserved[3]; > + u8 locked; > + }; > +#endif > }; > }; > > +#if _Q_PENDING_BITS == 8 That doesn't make s...
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 away. > * > * *,1,1 -> *,1,0 > + * > + * this wait loop must be a load-acquire such that we match the > + *...
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 away. > * > * *,1,1 -> *,1,0 > + * > + * this wait loop must be a load-acquire such that we match the > + *...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...gt; >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 away. > >> * > >> * *,1,1 -> *,1,0 > >>+ * > >>+ * this wait lo...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...gt; >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 away. > >> * > >> * *,1,1 -> *,1,0 > >>+ * > >>+ * this wait lo...
2014 Jun 15
0
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...to * unlock, and preserving API. + * + * N.B. The current implementation only supports architectures that allow + * atomic operations on smaller 8-bit and 16-bit data types. */ #include "mcs_spinlock.h" @@ -85,6 +89,87 @@ static inline struct mcs_spinlock *decod #define _Q_LOCKED_PENDING_MASK (_Q_LOCKED_MASK | _Q_PENDING_MASK) +/* + * By using the whole 2nd least significant byte for the pending bit, we + * can allow better optimization of the lock acquisition for the pending + * bit holder. + */ +#if _Q_PENDING_BITS == 8 + +struct __qspinlock { + union { + atomic_t val; + stru...
2014 Apr 17
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...and preserving API. + * + * N.B. The current implementation only supports architectures that allow + * atomic operations on smaller 8-bit and 16-bit data types. */ #include "mcs_spinlock.h" @@ -85,6 +93,87 @@ static inline struct mcs_spinlock *decode_tail(u32 tail) #define _Q_LOCKED_PENDING_MASK (_Q_LOCKED_MASK | _Q_PENDING_MASK) +/* + * By using the whole 2nd least significant byte for the pending bit, we + * can allow better optimization of the lock acquisition for the pending + * bit holder. + */ +#if _Q_PENDING_BITS == 8 + +struct __qspinlock { + union { + atomic_t val; + stru...
2020 Jul 25
0
[PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR
...gt; > > > Will, how do you feel about it? > > I can see it potentially being useful for debugging, but I hate the > > limitation to 256 CPUs. Even arm64 is hitting that now. > > After thinking more about that, I think we can use all the remaining bits in > the 16-bit locked_pending. Reserving 1 bit for locked and 1 bit for pending, > there are 14 bits left. So as long as NR_CPUS < 16k (requirement for 16-bit > locked_pending), we can put all possible cpu numbers into the lock. We can > also just use smp_processor_id() without additional percpu data. That sounds h...
2014 Jun 18
1
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...> + * N.B. The current implementation only supports architectures that allow > + * atomic operations on smaller 8-bit and 16-bit data types. > */ > > #include "mcs_spinlock.h" > @@ -85,6 +89,87 @@ static inline struct mcs_spinlock *decod > > #define _Q_LOCKED_PENDING_MASK (_Q_LOCKED_MASK | _Q_PENDING_MASK) > > +/* > + * By using the whole 2nd least significant byte for the pending bit, we > + * can allow better optimization of the lock acquisition for the pending > + * bit holder. > + */ > +#if _Q_PENDING_BITS == 8 > + > +struct __q...
2014 Jun 18
1
[PATCH 05/11] qspinlock: Optimize for smaller NR_CPUS
...> + * N.B. The current implementation only supports architectures that allow > + * atomic operations on smaller 8-bit and 16-bit data types. > */ > > #include "mcs_spinlock.h" > @@ -85,6 +89,87 @@ static inline struct mcs_spinlock *decod > > #define _Q_LOCKED_PENDING_MASK (_Q_LOCKED_MASK | _Q_PENDING_MASK) > > +/* > + * By using the whole 2nd least significant byte for the pending bit, we > + * can allow better optimization of the lock acquisition for the pending > + * bit holder. > + */ > +#if _Q_PENDING_BITS == 8 > + > +struct __q...
2014 Jun 15
0
[PATCH 07/11] qspinlock: Use a simple write to grab the lock, if applicable
...nding * bit holder. + * + * This internal structure is also used by the set_locked function which + * is not restricted to _Q_PENDING_BITS == 8. */ -#if _Q_PENDING_BITS == 8 - struct __qspinlock { union { atomic_t val; - struct { #ifdef __LITTLE_ENDIAN + u8 locked; + struct { u16 locked_pending; u16 tail; + }; #else + struct { u16 tail; u16 locked_pending; -#endif }; + struct { + u8 reserved[3]; + u8 locked; + }; +#endif }; }; +#if _Q_PENDING_BITS == 8 /** * clear_pending_set_locked - take ownership and clear the pending bit. * @lock: Pointer to queue spi...