From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Linux kernel mailing list <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@transmeta.com>
Subject: Re: Linux-2.5.28
Date: Thu, 25 Jul 2002 11:13:04 -0700 [thread overview]
Message-ID: <20020725111304.H14698@bougret.hpl.hp.com> (raw)
Linus wrote :
> In article <20020724170752.A14089@bougret.hpl.hp.com>,
> Jean Tourrilhes <jt@bougret.hpl.hp.com> wrote:
> >
> > IrDA is not going to get fixed soon. Over the time I've been
> >fixing the IrDA stack, I've slowly fixed some of most dangerous
> >locking problems, but fixing the remaining code will involve some
> >serious re-work and is unfortunately not just about sprinking a few
> >spinlocks there and there.
>
> Actually, the way to emulate cli/sti behaviour is not to "sprinkle"
> spinlocks, you can generally do it with _one_ spinlock per subsystem.
Unfortunately, it won't work for IrDA. The reason is that you
tend to have path like this :
IrLAP -> IrLMP -> IrTTP -> IrNET/IrCOMM/IrLAN/IrSock -> IrTTP -> IrLMP -> IrLAP
And I can't have one global spinlock for the IrDA stack,
because the higher layers (IrNET/IrCOMM/IrLAN/IrSOCK) are totally
independant and have their own locking (for example, I can guarantee
you the IrNET is already safe).
I'm also especially nervous about keeping a spinlock and irq
off while calling protocols higher layres, such as the various socket
function (IrSOCK), or the PPP mux (IrNET), or the TTY layer (IrCOMM).
My feeling is that doing the _one_ spinlock properly would be
as much work than fixing the root problem (the hasbins).
> So the straightforward way to port away from cli/sti is to add one
> spinlock which takes their place for that subsystem, and then get that
> lock on entry to subsystem interrupts and timer events, and in all
> places where there used to be a cli/sti.
Been there, done that. I've been the one doing most the
original SMP work in most Wireless LAN drivers (and the HP100 driver),
and I'm still the one doing most testing.
So, I feel qualified to comment about the IrDA situation.
> It gets a bit more complicated partly because you could nest cli/sti,
> and you can't nest spinlocks, but on the whole none of it is "rocket
> science".
No, here the problem is that the whole locking design is
broken. I know perfectly that the hashbin locking is totally unsafe
and it's a miracle that it work at all. And I'm not sure if I will
ever get something 100% safe.
> Of course, doing it _right_ (rather than try to just translate the
> semantics of cli/sti fairly directly) can be a lot more work. But even a
> straight translation improves on what used to be, since different
> subsystems will now be independent, and since it is easier later on to
> split the one lock up on a as-needed basis.
>
> Linus
Unfortunately, with the current IrDA code, I don't have much
choice but to do it somewhat right.
Now, it's a matter of priorities. The other IrDA developpers
have been bitten by "nothing is wrong" IDE in 2.5.X, so the logical
course of action is to shift to 2.4.X until I find time to get back to
this issue and catch up.
But having IrDA not functional in 2.5.X for a few months is
certainly not that painful compared to other problems in 2.5.X.
And as I was saying to Ingo, the good news is that I'll
probably also no longer will need "deliver_to_old_one()" in the
networking code.
Have fun...
Jean
next reply other threads:[~2002-07-25 18:09 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-25 18:13 Jean Tourrilhes [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-07-25 0:07 Linux-2.5.28 Jean Tourrilhes
2002-07-25 6:02 ` Linux-2.5.28 Linus Torvalds
2002-07-25 5:59 ` Linux-2.5.28 David S. Miller
2002-07-25 9:28 ` Linux-2.5.28 Ingo Molnar
2002-07-25 9:50 ` Linux-2.5.28 Marcin Dalecki
2002-07-25 9:59 ` Linux-2.5.28 Ingo Molnar
2002-07-25 10:18 ` Linux-2.5.28 David S. Miller
2002-07-24 21:13 Linux-2.5.28 Linus Torvalds
2002-07-24 21:46 ` Linux-2.5.28 Paul Larson
2002-07-24 21:57 ` Linux-2.5.28 Paul Larson
2002-07-24 22:11 ` Linux-2.5.28 Robert Love
2002-07-24 22:14 ` Linux-2.5.28 William Lee Irwin III
2002-07-24 22:20 ` Linux-2.5.28 Paul Larson
2002-07-24 23:31 ` Linux-2.5.28 Alessandro Suardi
2002-07-24 22:22 ` Linux-2.5.28 Robert Love
2002-07-24 22:49 ` Linux-2.5.28 Paul Larson
2002-07-24 22:32 ` Linux-2.5.28 Linus Torvalds
2002-07-24 22:30 ` Linux-2.5.28 Daniel Egger
2002-07-24 22:52 ` Linux-2.5.28 Linus Torvalds
2002-07-24 23:31 ` Linux-2.5.28 Daniel Egger
2002-07-25 1:08 ` Linux-2.5.28 Linus Torvalds
2002-07-25 1:54 ` Linux-2.5.28 Bartlomiej Zolnierkiewicz
2002-07-25 9:21 ` Linux-2.5.28 Daniel Egger
2002-07-27 23:57 ` Linux-2.5.28 Andries Brouwer
2002-07-28 2:02 ` Linux-2.5.28 Alan Cox
2002-07-28 2:47 ` Linux-2.5.28 Linus Torvalds
2002-07-28 4:40 ` Linux-2.5.28 Linus Torvalds
2002-07-28 4:47 ` Linux-2.5.28 Larry McVoy
2002-07-28 12:50 ` Linux-2.5.28 Bartlomiej Zolnierkiewicz
2002-07-28 15:11 ` Linux-2.5.28 Andries Brouwer
2002-07-28 2:47 ` Linux-2.5.28 Greg KH
2002-07-28 15:56 ` Linux-2.5.28 Andries Brouwer
2002-07-28 18:53 ` Linux-2.5.28 Greg KH
2002-07-28 21:13 ` Linux-2.5.28 Andries Brouwer
2002-07-29 10:16 ` Linux-2.5.28 Marcin Dalecki
2002-07-29 18:15 ` Linux-2.5.28 Greg KH
[not found] ` <200207282203.g6SM3KI15155@fachschaft.cup.uni-muenchen.de>
2002-07-28 23:34 ` Linux-2.5.28 Andries Brouwer
2002-07-24 23:06 ` Linux-2.5.28 Jonathan Corbet
2002-07-25 5:56 ` Linux-2.5.28 Jens Axboe
2002-07-25 7:36 ` Linux-2.5.28 Marcin Dalecki
2002-07-24 22:43 ` Linux-2.5.28 Russell King
2002-07-24 23:02 ` Linux-2.5.28 Linus Torvalds
2002-07-24 23:55 ` Linux-2.5.28 Skip Ford
2002-07-24 23:15 ` Linux-2.5.28 Dave Jones
2002-07-24 23:19 ` Linux-2.5.28 Linus Torvalds
2002-07-25 10:16 ` Linux-2.5.28 Alexander Hoogerhuis
2002-07-26 7:57 ` Linux-2.5.28 Marcin Dalecki
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=20020725111304.H14698@bougret.hpl.hp.com \
--to=jt@bougret.hpl.hp.com \
--cc=jt@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®