From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Maciej Soltysiak <solt@dns.toxicfilms.tv>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: spin_locks without smp.
Date: 10 Jan 2003 13:29:16 +0000 [thread overview]
Message-ID: <1042205356.28469.84.camel@irongate.swansea.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.51.0301101238560.6124@dns.toxicfilms.tv>
On Fri, 2003-01-10 at 11:42, Maciej Soltysiak wrote:
> Hi,
>
> while browsing through the network drivers about the etherleak issue i
> found that some drivers have:
>
> #ifdef CONFIG_SMP
> spin_lock_irqsave(...)
> #endif
>
> and some just:
>
> spin_lock_irqsave(...)
>
> or similar.
> Which version should be practiced? i thought spinlocks are irrelevant
> without SMP so we should use #ifdef to shorten the execution path.
Long answer: The network driver authors are doing some fairly clever
things to make old ISA adapters usable in Linux 2.4 and later. Linux
lacks the functionality to do
spin_lock_disable_irqmask(lock, flags, mask)
Implementing it is rather expensive and hard to do well. In general
those code paths need reviewing and probably to change to
preempt_disable()
#ifdef CONFIG_SMP
spin_lock_irqsave(..)
#endif
..
Please ensure that if you change these drivers you
a) Have the hardware and test it uniprocessor and SMP
b) Verify that with your change a serial modem port still works
c) Understand the game the author is playing
(Also d) ensure the author understands the games she/he is playing too!)
If you've been looking at the etherleak stuff btw, the -ac tree has what
is theoretically a full set of fixes. I'd love someone who is looking
at this into 2.5 to review them and merge them into the 2.5 tree. I
doubt I have them all right so more eyes is most welcome.
Alan
prev parent reply other threads:[~2003-01-10 12:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-10 11:42 Maciej Soltysiak
2003-01-10 11:45 ` William Lee Irwin III
2003-01-10 11:48 ` William Lee Irwin III
2003-01-10 12:09 ` [PATCH]Re: " Maciej Soltysiak
2003-01-10 13:20 ` Alan Cox
2003-01-10 13:04 ` William Lee Irwin III
2003-01-10 14:19 ` Alan Cox
2003-01-10 13:23 ` Alan Cox
2003-01-10 12:41 ` William Lee Irwin III
2003-01-10 13:29 ` Alan Cox [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=1042205356.28469.84.camel@irongate.swansea.linux.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=solt@dns.toxicfilms.tv \
/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
all inboxes | Powered by JetHome®