diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2009-02-13 01:43:17 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-13 01:43:17 +0100 |
commit | 99709372736a216f99eb32b76fba835a2bfc93a8 (patch) | |
tree | 62a84b976965436b841c65b63e52240d0b06bc29 /Documentation/connector/cn_test.c | |
parent | IRDA: cnt is off by 1 (diff) | |
download | linux-99709372736a216f99eb32b76fba835a2bfc93a8.tar.xz linux-99709372736a216f99eb32b76fba835a2bfc93a8.zip |
net: don't use in_atomic() in gfp_any()
The problem is that in_atomic() will return false inside spinlocks if
CONFIG_PREEMPT=n. This will lead to deadlockable GFP_KERNEL allocations
from spinlocked regions.
Secondly, if CONFIG_PREEMPT=y, this bug solves itself because networking
will instead use GFP_ATOMIC from this callsite. Hence we won't get the
might_sleep() debugging warnings which would have informed us of the buggy
callsites.
Solve both these problems by switching to in_interrupt(). Now, if someone
runs a gfp_any() allocation from inside spinlock we will get the warning
if CONFIG_PREEMPT=y.
I reviewed all callsites and most of them were too complex for my little
brain and none of them documented their interface requirements. I have no
idea what this patch will do.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/connector/cn_test.c')
0 files changed, 0 insertions, 0 deletions