Re: [PATCH][5/8] Arch agnostic completely out of line locks / ppc64

From: Paul Mackerras
Date: Thu Sep 09 2004 - 00:42:53 EST


Zwane,

Just got a chance to look at the new out-of-line spinlock stuff
(better late than never :). I see a couple of problems there. First,
we now go two levels deep on SMP && PREEMPT: spin_lock is _spin_lock,
which is out of line in kernel/sched.c. That calls
__preempt_spin_lock, which is out of line in kernel/sched.c, and isn't
in the .text.lock section. So if we get a timer interrupt in there,
we won't attribute the profile tick to the original caller.

The second problem is that __preempt_spin_lock doesn't do the yield to
the hypervisor which we need to do on shared processor systems. This
is actually a long-standing problem, not one you have just introduced,
but I have only just noticed it. I can't make cpu_relax do the yield
because the yield is a directed yield to a specific other virtual cpu
(it says "give the rest of my timeslice to that guy over there") and I
need the value in the lock variable in order to know who is holding
the lock.

Regards,
Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/