diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2002-05-21 22:23:59 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-05-21 22:23:59 -0700 |
commit | 57078435cabebaad6c4590e1340c01e3c17a46a8 (patch) | |
tree | f679fac2ac542341d309c493973ae6a732d2b199 /net/lapb/lapb_timer.c | |
parent | 87c2543780d197d268c09302fcb408a2afe8ff0b (diff) |
[PATCH] smp_call_function doco fix
Trivial patch update against 2.5.17:
dipankar@in.ibm.com: smp_call_function change:
My earlier patch fixed only i386. As per Dave Miller's suggestion,
I have fixed smp_call_function for other smp architectures too.
Description
-----------
Going by the documentation and use of _bh version of spin_lock(),
smp_call_function() is allowed to be called from BH context,
We can run into a deadlock with some locks if we do so.
This because reader-writer locks can sometimes be used optimally
by not disabling irqs while taking the reader side if only the
reader side of the lock is taken from irq context.
CPU #0 CPU #1
read_lock(&tasklist_lock)
write_lock_irq(&tasklist_lock)
[spins with interrupt disabled]
[Interrupted by BH]
smp_call_function() for BH
handler
[ doesn't take the IPI]
So, cpu #1 doesn't take the IPI and cpu #0 spinwaits
for the IPI handler to start, resulting in a deadlock.
The last time I looked, I couldn't see smp_call_function() being
called from BH context anywhere. So, there is no immediate problem.
However it seems right to correct the documentation and also not
disable BH while taking the call lock since it isn't necessary.
This patch does exactly that.
Thanks
--
Dipankar Sarma <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.
smp_call_func-2.5.14-1.patch
----------------------------
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions