2.6.24-rc6-mm1
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · Andrew Morton
No, the problem is that
include/crypto/scatterwalk.hdoesn't include enough header files to support its inlining fetish. It needssched.h.
I'll get it fixed in cryptodev.
Quoted 2 lines
Ingo, it's not good that we have
cond_resched()definitions conditionally duplicated inkernel.h- that's increasing the risk of bugs like this one.
Actually, why do we even have cond_resched when real preemption is on? It seems to be a waste of space and time.
Any objections to something like this to remove cond_resched with CONFIG_PREEMPT on (apart from the potential to uncover more bugs like this one)?
Cheers,
Signature · 5 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--include/linux/kernel.h +2 -2
@@ -105,8 +105,8 @@ struct user;* supposed to. */ #ifdef CONFIG_PREEMPT_VOLUNTARY -extern int cond_resched (void ); -# define might_resched () cond_resched() +extern int _cond_resched (void ); +# define might_resched () _cond_resched()#else # define might_resched () do { } while (0)#endif
include/linux/sched.h +12 -1
@@ -1863,7 +1863,18 @@ static inline int need_resched(void)* cond_resched_lock() will drop the spinlock before scheduling, * cond_resched_softirq() will enable bhs before scheduling. */ -extern int cond_resched (void ); +#ifdef CONFIG_PREEMPT +static inline int cond_resched (void ) +{ +return 0 ; +} +#else +extern int _cond_resched (void ); +static inline int cond_resched (void ) +{ +return _cond_resched (); +} +#endif extern int cond_resched_lock (spinlock_t * lock);extern int cond_resched_softirq (void );
kernel/sched.c +4 -2
@@ -4683,7 +4683,8 @@ static void __cond_resched(void) }while (need_resched ()); } -int __sched cond_resched(void) +#if !defined(CONFIG_PREEMPT ) || defined(CONFIG_PREEMPT_VOLUNTARY ) +int __sched _cond_resched(void) {if (need_resched () && !(preempt_count () &PREEMPT_ACTIVE ) && system_state ==SYSTEM_RUNNING ) {
@@ -4692,7 +4693,8 @@ int __sched cond_resched(void) }return 0 ; } -EXPORT_SYMBOL (cond_resched); +EXPORT_SYMBOL (_cond_resched); +#endif /* * cond_resched_lock() - if a reschedule is pending, drop the given lock,
Quoted 6 lines · Herbert Xu
Quoted 3 lines
Ingo, it's not good that we have
cond_resched()definitions conditionally duplicated inkernel.h- that's increasing the risk of bugs like this one.Actually, why do we even have
cond_reschedwhen real preemption is on? It seems to be a waste of space and time.
due to the BKL. cond_resched() in BKL code breaks up BKL latencies.
i dont mind not doing that though - we should increase the pain for BKL users, so that subsystems finally get rid of it altogether. lock_kernel() use within the kernel is still rampant - there are still more than 400 callsites to lock_kernel().
Ingo
Quoted 8 lines · Ingo Molnar
Quoted 6 lines · Herbert Xu
Quoted 3 lines
Ingo, it's not good that we have
cond_resched()definitions conditionally duplicated inkernel.h- that's increasing the risk of bugs like this one.Actually, why do we even have
cond_reschedwhen real preemption is on? It seems to be a waste of space and time.
Quoted 6 lines
due to the BKL.
cond_resched()in BKL code breaks up BKL latencies.i dont mind not doing that though - we should increase the pain for BKL users, so that subsystems finally get rid of it altogether.
lock_kernel()use within the kernel is still rampant - there are still more than 400 callsites tolock_kernel().
It would be silly to potentially increase latency in some areas for CONFIG_PREEMPT kernels, though.
Better may be to detect when there is CONFIG_PREEMPT and CONFIG_PREEMPT_BKL, and ifdef away the cond_resched in that case (or -- why do we even make CONFIG_PREEMPT_BKL an option? Are there really workloads left where it causes throughput regressions?)
Peter Zijlstra
maintainerQuoted 16 lines · Nick Piggin
Quoted 8 lines · Ingo Molnar
Quoted 6 lines · Herbert Xu
Quoted 3 lines
Ingo, it's not good that we have
cond_resched()definitions conditionally duplicated inkernel.h- that's increasing the risk of bugs like this one.Actually, why do we even have
cond_reschedwhen real preemption is on? It seems to be a waste of space and time.Quoted 6 lines
due to the BKL.
cond_resched()in BKL code breaks up BKL latencies.i dont mind not doing that though - we should increase the pain for BKL users, so that subsystems finally get rid of it altogether.
lock_kernel()use within the kernel is still rampant - there are still more than 400 callsites tolock_kernel().
Quoted 7 lines
It would be silly to potentially increase latency in some areas for
CONFIG_PREEMPTkernels, though.Better may be to detect when there is
CONFIG_PREEMPTandCONFIG_PREEMPT_BKL, and ifdef away thecond_reschedin that case (or -- why do we even makeCONFIG_PREEMPT_BKLan option? Are there really workloads left where it causes throughput regressions?)
I've seen 1s+ desktop latencies due to PREEMPT_BKL when I was still using reiserfs.
Both reiserfs and tty were fighting for the bkl and massive prio inversion ensued. Turning PREEMPT_BKL off made the system usable again.
Quoted 20 lines · Peter Zijlstra
Quoted 19 lines · Nick Piggin
Quoted 8 lines · Ingo Molnar
Quoted 6 lines · Herbert Xu
Quoted 3 lines
Ingo, it's not good that we have
cond_resched()definitions conditionally duplicated inkernel.h- that's increasing the risk of bugs like this one.Actually, why do we even have
cond_reschedwhen real preemption is on? It seems to be a waste of space and time.Quoted 6 lines
due to the BKL.
cond_resched()in BKL code breaks up BKL latencies.i dont mind not doing that though - we should increase the pain for BKL users, so that subsystems finally get rid of it altogether.
lock_kernel()use within the kernel is still rampant - there are still more than 400 callsites tolock_kernel().It would be silly to potentially increase latency in some areas for
CONFIG_PREEMPTkernels, though.
Quoted 7 lines
Quoted 4 lines
Better may be to detect when there is
CONFIG_PREEMPTandCONFIG_PREEMPT_BKL, and ifdef away thecond_reschedin that case (or -- why do we even makeCONFIG_PREEMPT_BKLan option? Are there really workloads left where it causes throughput regressions?)I've seen 1s+ desktop latencies due to
PREEMPT_BKLwhen I was still using reiserfs.
Fair enough; so the former ifdefery would be preferable for now then.
Quoted 2 lines
Both reiserfs and tty were fighting for the bkl and massive prio inversion ensued. Turning
PREEMPT_BKLoff made the system usable again.
Are either of those subsystems actually using the BKL to protect against anything else (than themselves)? It would be sweet to have them use private mutexes for the job instead (although even then it probably wouldn't be a straight conversion)...
Peter Zijlstra
maintainerQuoted 6 lines · Nick Piggin
Quoted 2 lines · Peter Zijlstra
I've seen 1s+ desktop latencies due to
PREEMPT_BKLwhen I was still using reiserfs.Fair enough; so the former ifdefery would be preferable for now then.
To be honest, I must mention that the load that did that was a kernel build -j5 on a dual socket Athlon MP box. With a current kernel and XFS that load is making the box slow but its still very servicable.
Quoted 5 lines
Quoted 2 lines
Both reiserfs and tty were fighting for the bkl and massive prio inversion ensued. Turning
PREEMPT_BKLoff made the system usable again.Are either of those subsystems actually using the BKL to protect against anything else (than themselves)?
I doubt it.
IIRC Alan is working on getting tty BKL free.
Quoted 3 lines
It would be sweet to have them use
private mutexes for the job instead (although even then it probably wouldn't be a straight conversion)...
I tried a quick conversion of reiser3 at the time, but it really wants a recursive lock and I couldn't be bothered to fix a 'legacy' filesystem so I just gave up and converted the filesystem to XFS.
Quoted 7 lines · Peter Zijlstra
Quoted 3 lines
It would be sweet to have them use private mutexes for the job
instead (although even then it probably wouldn't be a straight conversion)...I tried a quick conversion of reiser3 at the time, but it really wants a recursive lock and I couldn't be bothered to fix a 'legacy' filesystem so I just gave up and converted the filesystem to XFS.
as long as the only requirement is recursion, and not any of the other BKL properties, that could be wrapped. I guess fixing the TTY code to have no BKL dependencies has a higher chance of success - given that Alan is working on it :-)
Ingo
Quoted 3 lines
BKL properties, that could be wrapped. I guess fixing the TTY code to have no BKL dependencies has a higher chance of success - given that Alan is working on it :-)
Bit by bit when I can face it, and with a lot of other people contributing parts. Right now the BKL mostly protects the open/close paths and those are *really* ugly
Quoted 7 lines · Alan Cox
Quoted 3 lines
BKL properties, that could be wrapped. I guess fixing the TTY code to have no BKL dependencies has a higher chance of success - given that Alan is working on it :-)
Bit by bit when I can face it, and with a lot of other people contributing parts. Right now the BKL mostly protects the open/close paths and those are *really* ugly
could we perhaps just replace it with a tty_mutex? (possibly a recursive one) I suspect by now most of the BKL dependencies there have become local to the tty code? Or are there deep VFS dependencies as well? (if yes, what type of dependencies?)
Ingo
Quoted 4 lines
could we perhaps just replace it with a
tty_mutex? (possibly a recursive one) I suspect by now most of the BKL dependencies there have become local to the tty code? Or are there deep VFS dependencies as well? (if yes, what type of dependencies?)
The big problem is that nobody actually knows where all the dependancies are. That is why I've started with the bits we can decipher so that it simplifies the mess each time we clean up the locking of some lower level aspect.
Almost all the serial drivers clone the same open and release methods (or worse older versions of it) so that also needs doing. Lots to do, so little time.
tty + BKL [Was: 2.6.24-rc6-mm1]
Quoted 3 lines · Alan Cox
Almost all the serial drivers clone the same open and release methods (or worse older versions of it) so that also needs doing. Lots to do, so little time.
Could you be more specific here please, maybe somebody could help.
Quoted 1 line · Nick Piggin
(or -- why do we even make
CONFIG_PREEMPT_BKLan option? [...]
thanks for the reminder - i just zapped it. Was a pleasure ;-)
Ingo