netdev
[Top] [All Lists]

Re: BUG or not? GFP_KERNEL with interrupts disabled.

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: BUG or not? GFP_KERNEL with interrupts disabled.
From: Linus Torvalds <torvalds@xxxxxxxxxxxxx>
Date: Thu, 27 Mar 2003 11:22:55 -0800 (PST)
Cc: dane@xxxxxxxxxx, <shmulik.hen@xxxxxxxxx>, <bonding-devel@xxxxxxxxxxxxxxxxxxxxx>, <bonding-announce@xxxxxxxxxxxxxxxxxxxxx>, <netdev@xxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <linux-net@xxxxxxxxxxxxxxx>, <mingo@xxxxxxxxxx>, <kuznet@xxxxxxxxxxxxx>
In-reply-to: <20030327.111012.23672715.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Thu, 27 Mar 2003, David S. Miller wrote:
> 
> Let's codify this "in_atomic() || irqs_disabled()" test into a macro
> that everyone can use to test sleepability, ok?

Well, I really don't want people to act dynamically differently depending 
on whether they can sleep or not. That makes static sanity-testing 
impossible. So I really think that the only really valid use of the above 
is on one single place: might_sleep().

Which right now doesn't do the "irqs_disabled()" test, but otherwise looks 
good. So the code should really just say

        if (gfp_mask & __GFP_WAIT)
                might_sleep();

and might_sleep() should be updated.

Anybody want to try that and see whether things break horribly?

                Linus


<Prev in Thread] Current Thread [Next in Thread>