From: David Miller <davem@davemloft.net>
To: akpm@linux-foundation.org
Cc: netdev@vger.kernel.org, andi@firstfloor.org
Subject: Re: [patch 1/2] net: don't use in_atomic() in gfp_any()
Date: Thu, 12 Feb 2009 16:43:30 -0800 (PST) [thread overview]
Message-ID: <20090212.164330.59402005.davem@davemloft.net> (raw)
In-Reply-To: <200902112127.n1BLRJeJ031575@imap1.linux-foundation.org>
From: akpm@linux-foundation.org
Date: Wed, 11 Feb 2009 13:27:19 -0800
> 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>
Applied.
prev parent reply other threads:[~2009-02-13 0:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-11 21:27 [patch 1/2] net: don't use in_atomic() in gfp_any() akpm
2009-02-11 21:38 ` Tetsuo Handa
2009-02-11 21:48 ` Andrew Morton
2009-02-11 22:02 ` David Miller
2009-02-11 21:49 ` Andrew Morton
2009-02-13 0:43 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090212.164330.59402005.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).