Linux-2.5.28
Quoted 8 lines · Alessandro Suardi
But, on my UP:
if [ -r System.map ]; then
/sbin/depmod-ae -F System.map 2.5.28; fi
depmod: *** Unresolved symbols in/lib/modules/2.5.28/kernel/net/irda/irda.o
depmod: cli
depmod:restore_flags
depmod:save_flags
Quoted 6 lines
(and no,
CONFIG_SMPis not set :)Ciao,
--alessandro
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.
That's life... Jean
In article <[email protected]>,
Quoted 6 lines · Jean Tourrilhes
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.
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.
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".
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
From: [email protected] (Linus Torvalds)
Date: Thu, 25 Jul 2002 06:02:04 +0000 (UTC)
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".
Actually the "rocket science" part is that these "cli()" users in the unmaintained net stacks also want cli() to shut up input packet processing as well as TIMER_BH.
This means they assume that cli() means "nobody can even look at the existence of any of the timers". Ie. they do this to ensure they can simply del_timer and there is no possibility someone sits inside of the actual handler.
Of course del_timer_sync can be used to deal with that specific case. But this specific example is just the tip of the iceberg.
I really think it is unwise to even imply that this kind of cli/sti fixup can be done in some mindless manner, it really can't :-)
Quoted 2 lines · David S. Miller
I really think it is unwise to even imply that this kind of cli/sti fixup can be done in some mindless manner, it really can't :-)
i think the networking code is a special case - nothing else relies on the interaction of timers and IRQ contexts in such a deep way. (which it does for performance reasons.) I'd say 99% of all cli()/sti() users are in the 'introduce a per-driver or per-subsystem lock' league Linus mentioned.
Ingo
Quoted 11 lines · Ingo Molnar
Quoted 2 lines · David S. Miller
I really think it is unwise to even imply that this kind of cli/sti fixup can be done in some mindless manner, it really can't :-)
i think the networking code is a special case - nothing else relies on the interaction of timers and IRQ contexts in such a deep way. (which it does for performance reasons.) I'd say 99% of all cli()/sti() users are in the 'introduce a per-driver or per-subsystem lock' league Linus mentioned.
Carefull.... The ATA host controller patches showed that mindless fixing
would just hide the fact that, well let me guess, 50% of cli() sti()
are remnants from the days we didn't even have spin locks or
are simple used becouse somone feeled like he needs "kind of safety"
and wanted to make some thing "bullet proof".. And it's easier to see this kind of aplication on cli() then on "carefully" added spinlocking. Becouse in the case of spinlocks there is always a chance that they interact with some code you don't see when looking at a particular place of usage of course...
Quoted 2 lines · Marcin Dalecki
Carefull.... The ATA host controller patches showed that mindless fixing would just hide the fact that, [...]
the main.c change was, frankly, trivially broken. The function that called the unregister function already held the ide_lock. We have a debugging mechanism to detect such bugs as they happen (the NMI watchdog), so it's relatively straightforward (of course not easy) to extend the use of ide_lock.
the more subtle cases are when the code somehow relies on cli() excluding multiple IRQ contexts and BH contexts for example.
Ingo
From: Ingo Molnar <[email protected]>
Date: Thu, 25 Jul 2002 11:28:15 +0200 (CEST)
i think the networking code is a special case - nothing else relies on the interaction of timers and IRQ contexts in such a deep way. (which it does for performance reasons.) I'd say 99% of all cli()/sti() users are in the 'introduce a per-driver or per-subsystem lock' league Linus mentioned.
I'm sure the serial drivers used to. Look at how they were using SERIAL_BH for example.
RMK's stuff fixes that so wrt. the current state of affairs you're probably right.