[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090211134942.a800067e.akpm@linux-foundation.org>
Date: Wed, 11 Feb 2009 13:49:42 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [patch 1/2] net: don't use in_atomic() in gfp_any()
Resend with cc's restored. Please DO NOT edit the Cc: line :(
On Thu, 12 Feb 2009 06:38:55 +0900
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp> wrote:
> Andrew Morton wrote:
> > 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.
>
> > static inline gfp_t gfp_any(void)
> > {
> > - return in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
> > + return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
> > }
> sed -i -e 's/in_softirq/in_interrupt/' ?
heh, good question.
I did all my testing with in_softirq() - the changelog didn't catch up.
Is gfp_any() supposed to be usable from hardirq context?
If so, we should use in_interrupt().
If not, we should use in_softirq(), and we'll then get might_sleep()
warnings if anyone uses gfp_any() from hard irq context.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists