From: Linus Torvalds <torvalds@transmeta.com>
To: Kanoj Sarcar <kanoj@google.engr.sgi.com>
Cc: riel@nl.linux.org, "Stephen C. Tweedie" <sct@redhat.com>,
linux-mm@kvack.org, linux-kernel@vger.rutgers.edu
Subject: Re: [patch] 2.3.99-pre6-3 VM fixed
Date: Thu, 27 Apr 2000 14:24:18 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.10.10004271420480.1162-100000@penguin.transmeta.com> (raw)
In-Reply-To: <200004272020.NAA00247@google.engr.sgi.com>
On Thu, 27 Apr 2000, Kanoj Sarcar wrote:
>
> I really need to learn the locking rules for the kernel. As far as
> I can see, lock_kernel is a spinning monitor, so any intr code should
> be able to grab lock_kernel.
No.
Interrupts must NOT grab the kernel lock.
It's not because of the regular dead-lock concerns (an interrupt could
just increment the lock counter), but because of more subtle issues: the
counter maintenance is not atomic, and should not be atomic. For example,
during re-schedules we drop the kernel lock flag ("kernel_flag", but we
still maintain the lock counter), so an interrupt that came in at that
time would _think_ that it got the kernel lock (because the counter is
non-zero), but it really doesn't get it.
Linus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
next prev parent reply other threads:[~2000-04-27 21:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-26 13:36 Rik van Riel
2000-04-27 16:28 ` Stephen C. Tweedie
2000-04-27 19:56 ` Rik van Riel
2000-04-27 20:20 ` Kanoj Sarcar
2000-04-27 21:24 ` Linus Torvalds [this message]
2000-04-28 15:50 ` Linus Torvalds
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=Pine.LNX.4.10.10004271420480.1162-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=kanoj@google.engr.sgi.com \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=riel@nl.linux.org \
--cc=sct@redhat.com \
/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