From: "Brian O'Mahoney" <omb@khandalf.com>
To: Mateusz Berezecki <mateuszb@gmail.com>, linux-kernel@vger.kernel.org
Subject: schedule while atomic
Date: Tue, 12 Jul 2005 21:56:43 +0200 [thread overview]
Message-ID: <42D4207B.7060002@khandalf.com> (raw)
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.
reply other threads:[~2005-07-12 19:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42D4207B.7060002@khandalf.com \
--to=omb@khandalf.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mateuszb@gmail.com \
--cc=omb@bluewin.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox