From: "Manfred Spraul" <manfred@colorfullife.com>
To: "Paul Clements" <kernel@steeleye.com>, "Andrew Morton" <akpm@zip.com.au>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] 2.4.18 raid1 - fix SMP locking/interrupt
Date: Mon, 25 Mar 2002 20:50:26 +0100 [thread overview]
Message-ID: <001001c1d436$90abdf70$010411ac@local> (raw)
>
> However a bare spin_unlock_irq() in a function means that
> callers which wish to keep interrupts disabled are subtly
> subverted. We've had bugs from this before.
>
It is trivial to catch such bugs at runtime. I tried it a year ago, and
immediately run into sleep_on() users that legitimately call
spin_lock_irq() with disabled interrupts. Perhaps they are gone now,
I'll retest my patch.
> So the irqrestore functions are much more robust. I believe
> that they should be the default choice. The non-restore
> versions should be viewed as a micro-optimised version,
> to be used with caution. The additional expense of the save/restore
> is quite tiny - 20-30 cycles, perhaps.
OTHO, if a function doesn't work correctly if it's called with disabled
interrupts, then it should not use spin_lock_irqsave() - it's
misleading.
e.g. if it calls kmalloc(GFP_KERNEL), down(), schedule(), etc.
--
Manfred
next reply other threads:[~2002-03-25 19:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-25 19:50 Manfred Spraul [this message]
2002-03-25 20:22 ` [PATCH] 2.4.18 raid1 - fix SMP locking/interrupt Andrew Morton
2002-03-25 20:57 ` Manfred Spraul
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='001001c1d436$90abdf70$010411ac@local' \
--to=manfred@colorfullife.com \
--cc=akpm@zip.com.au \
--cc=kernel@steeleye.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.