lkml.org 
[lkml]   [2005]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectschedule while atomic
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-12 22:01    [W:0.044 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site