schedule while atomic

From: Brian O'Mahoney
Date: Tue Jul 12 2005 - 14:59:05 EST


More importantly _exactly_what_ are you using the LOCK to protect?

Short recap, spinlocks are used to serialise, ie prevent races in SMP
systems, where turning the interrupts off, on a single processor, is
NOT good enough to prevent races between interrupt-handlers and core
kernel code accessing shared-common-data eg managing a linked list
where the data structure would be mangled by shared access; thus
the lock should be taken and released _for_the_shortest_time_possible_
eg

get lock
unlink head of list
give lock

and so on, so get the lock only when you need it, and give it back as
soon as the transaction is done; also design the data-structure so that
complex, long lasting transactions are un-necessary.

see also RCU.

--
mit freundlichen Grüßen, Brian.


-
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/