Re: [patch] killed tqueue_lock spinlock, Re: [patch] race-fix for bottom-half-functions [Re: Subtle

Andrea Arcangeli (andrea@e-mind.com)
Sun, 31 Jan 1999 23:40:59 +0100 (CET)


On Sun, 31 Jan 1999 yodaiken@chelm.cs.nmt.edu wrote:

> Actually, the code as rewritten will work from rt space, but shouldn't
> it do a save_flags/restore_flags

Woops, this incremental patch is needed:

Index: include/linux/tqueue.h
===================================================================
RCS file: /var/cvs/linux/include/linux/tqueue.h,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 tqueue.h
--- tqueue.h 1999/01/31 02:36:23 1.1.2.2
+++ tqueue.h 1999/01/31 20:33:55
@@ -77,17 +77,20 @@
task_queue *bh_list)
{
if (!test_and_set_bit(0,&bh_pointer->sync)) {
+ unsigned long flags;
+
bh_pointer->sync |= 2;
wmb();
/*
* Disable local interrupt to avoid the CPU to run a nested
* run_task_queue() while bit1 is set. -arca
*/
+ __save_flags(flags);
__cli();
bh_pointer->next = xchg(bh_list,bh_pointer);
clear_bit(1,&bh_pointer->sync); /* see run_task */
wmb();
- __sti();
+ __restore_flags(flags);
}
}

Thanks ;).

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/