Andrew Morton 9970937273 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>
2009-02-12 16:43:17 -08:00
..
2008-10-22 18:54:47 -05:00
2008-09-12 16:30:20 -07:00
2007-10-10 16:53:56 -07:00
2008-12-19 15:22:54 -05:00
2008-11-25 17:35:18 -08:00
2008-11-25 17:35:18 -08:00
2008-07-05 21:26:57 -07:00
2008-06-11 21:00:38 -07:00
2008-06-11 21:00:38 -07:00
2008-11-25 18:00:48 -08:00
2008-06-11 21:00:38 -07:00
2008-02-29 11:46:17 -08:00
2008-03-28 16:28:36 -07:00
2009-01-16 17:08:23 -05:00
2008-11-12 00:54:54 -08:00
2009-01-06 11:38:15 -07:00
2008-11-16 23:01:49 -08:00
2009-01-08 10:40:57 -08:00
2008-11-14 11:29:12 +11:00
2008-06-11 21:00:38 -07:00
2009-02-12 16:43:17 -08:00
2008-07-05 21:25:39 -07:00
2008-12-15 23:43:36 -08:00
2008-11-16 19:39:21 -08:00
2008-11-25 18:00:48 -08:00