From: Gerhard F. <ger...@mc...> - 2000-09-17 18:55:36
|
Gerhard Fuernkranz wrote: > > There is one more thing, which gives me a strange feeling in my stomach, > and that's the fact, that somebody had reported that start_bh_atomic() > and friends do no longer exist in newer 2.3 kernels. Actually I had used > them to prevent races between the top and bottom halves - so I've no > idea what will happen, if they are just skipped. After a very short look at the current SuSE 6.4 (-> 2.2.14) sources it appears, that ret_from_intr in entry.S does *NOT* run the bottom halfes - except it reschedules the current process (in this case schedule() runs them). But as long as the top half is running in the kernel, the process should not be rescheduled. Therefore I think, that an interrupt should not be able trigger a bottom half handler, which can interrupt the top half running in kernel mode (-> in an UP(!!!) kernel). But I've taken only a very short look and I could have overlooked something ... So IMHO there is a chance, that explicit locking between the top and bottom halfes is no longer required (for UP kernels) and is just a relict which was required in some older kernel version (maybe 2.0???). I cannot remember ... Probably they also have removed start_bh_atomic() and friends from recent 2.3 kernels, because it is no longer required? (in UP kernels and SMP kernels need different locking methods anyway). Nevertheless all the locking stuff in the drivers should be investigated very carefully, especially SMP locking, which is currently definitely not supported (i.e. missing) in ieee*.c. E.g. if the start_bh_atomic() go away, then there are no locks at all, which will prevent a top half from running on one processor while a bottom half is running on a different processor simultaneouly. So spinlocks must be added to protect critical regions in order to handle such situations properly. Gerhard |