From: Jens Axboe <axboe@suse.de>
To: Heiko.Rabe@InVision.de
Cc: linux-kernel@vger.kernel.org
Subject: Re: inconsistent usage of
Date: Tue, 22 Apr 2003 11:25:36 +0200 [thread overview]
Message-ID: <20030422092536.GH4911@suse.de> (raw)
In-Reply-To: <OF07767E6D.29E660DD-ONC1256D10.002B8A2D@invision.de>
On Tue, Apr 22 2003, Heiko.Rabe@InVision.de wrote:
> I found inconsistent behavoir between SMP oand none SMP kernels using spin
> locks inside driver programming
> As first an simple example:
>
> static spinlock_t qtlock = SPIN_LOCK_UNLOCKED;
>
> void foo()
> {
> unsigned long local_flags;
> spin_lock_irqsave (&qtlock, local_flags);
> spin_lock_irqsave (&qtlock, local_flags);
> }
[snip rant]
Check the spinlock implementation. All the above does in UP is
disable/save interrupts twice. The actual spinlock is a nop. As only one
processor can be executing inside the kernel in UP, you only need to
guard against interrupts.
--
Jens Axboe
prev parent reply other threads:[~2003-04-22 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-22 8:11 inconsistent usage of Heiko.Rabe
2003-04-22 8:40 ` Duncan Sands
2003-04-22 9:21 ` viro
2003-04-22 9:25 ` Jens Axboe [this message]
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=20030422092536.GH4911@suse.de \
--to=axboe@suse.de \
--cc=Heiko.Rabe@InVision.de \
--cc=linux-kernel@vger.kernel.org \
/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