RE: spinlock-consolidation.patch

Luck, Tony
2005-09-09T21:04:17Z

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

>Guys, I'm planning on sending this Linuswards in about two days time.
>There's never a right time for this sort of thing and there may be some
>relatively trivial breakage for architectures I don't test for. But it
>kills 1300 lines of code.
>
>So. Last call, please...

Current ia64 code in Linus' tree includes code in arch/ia64/kernel/mca.c
like this:

#ifdef CONFIG_SMP
/* read_trylock() would be handy... */
if (!tasklist_lock.write_lock)
read_lock(&tasklist_lock);
#endif

which breaks all the SMP ia64 builds with your patch applied. Keith
Owens has already cleaned up this code to use read_trylock() in my
test tree (and thus in -mm). But that is part of a much bigger change
that adds a couple of new functions to kernel/sched.c that Keith
only posted to LKML yesterday (http://tinyurl.com/8urfm), since Zwane
has already posed a question about this change it seems unlikely that
this will be resolved before the cut-off for big merges.

So you need to add the attached patch to yours before sending to Linus.

-Tony

[-- Attachment #2: ia64-fix-spinlock.patch --]
[-- Type: application/octet-stream, Size: 962 bytes --]

[IA64] Clean-up direct access to tasklist_lock.write_lock

Signed-off-by: Tony Luck <tony.luck@intel.com>

diff -ru linux/arch/ia64/kernel/mca.c tiger-smp/arch/ia64/kernel/mca.c
--- linux/arch/ia64/kernel/mca.c 2005-09-09 13:13:12.000000000 -0700
+++ tiger-smp/arch/ia64/kernel/mca.c 2005-09-09 13:49:47.000000000 -0700
@@ -491,12 +491,7 @@
unw_init_from_interruption(&info, current, pt, sw);
ia64_do_show_stack(&info, NULL);

-#ifdef CONFIG_SMP
- /* read_trylock() would be handy... */
- if (!tasklist_lock.write_lock)
- read_lock(&tasklist_lock);
-#endif
- {
+ if (read_trylock(&tasklist_lock)) {
struct task_struct *g, *t;
do_each_thread (g, t) {
if (t == current)
@@ -506,10 +501,6 @@
show_stack(t, NULL);
} while_each_thread (g, t);
}
-#ifdef CONFIG_SMP
- if (!tasklist_lock.write_lock)
- read_unlock(&tasklist_lock);
-#endif

printk("\nINIT dump complete. Please reboot now.\n");
while (1); /* hang city if no debugger */