Thread (14 messages) flat view 14 messages, 6 authors, 2014-02-11

Re: [PATCH v2] powerpc ticket locks

From: Raghavendra KT <hidden>
Date: 2014-02-11 09:53:57
Also in: lkml

On Mon, Feb 10, 2014 at 8:40 AM, Benjamin Herrenschmidt
[off-list ref] wrote:
On Fri, 2014-02-07 at 17:58 +0100, Torsten Duwe wrote:
quoted
 typedef struct {
-       volatile unsigned int slock;
-} arch_spinlock_t;
+       union {
+               __ticketpair_t head_tail;
+               struct __raw_tickets {
+#ifdef __BIG_ENDIAN__          /* The "tail" part should be in the MSBs */
+                       __ticket_t tail, head;
+#else
+                       __ticket_t head, tail;
+#endif
+               } tickets;
+       };
+#if defined(CONFIG_PPC_SPLPAR)
+       u32 holder;
+#endif
+} arch_spinlock_t __aligned(4);
That's still broken with lockref (which we just merged).

We must have the arch_spinlock_t and the ref in the same 64-bit word
otherwise it will break.

We can make it work in theory since the holder doesn't have to be
accessed atomically, but the practicals are a complete mess ...
lockref would essentially have to re-implement the holder handling
of the spinlocks and use lower level ticket stuff.
Probably very basic and stupid question from me.
How much important to have holder information for PPC? From my
previous experiment
on x86, it was lock-waiter preemption which is problematic rather than
lock-holder preemption.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help