From: Andi Kleen <andi@firstfloor•org>
To: Andrew Morton <akpm@linux-foundation•org>
Cc: Andi Kleen <andi@firstfloor•org>,
roger.larsson@e-gatan•se, linux-kernel@vger•kernel.org,
mingo@elte•hu, rml@tech9•net, pavel@ucw•cz,
netdev@vger•kernel.org
Subject: Re: PROBLEM: in_atomic() misuse all over the place
Date: Sat, 31 Jan 2009 06:55:08 +0100 [thread overview]
Message-ID: <20090131055508.GD18453@one.firstfloor.org> (raw)
In-Reply-To: <20090130160316.7e53ef99.akpm@linux-foundation.org>
> There's a bit of a problem here. If someone accidentally uses
> gfp_any() inside a spinlock, it will do a sleeping allocation on
> non-preempt kernels and will do an atomic allocation on preemptible
> kernels, so we won't get to see the warning which would allow us to fix
> the bug.
Yes exporting the function to drivers is dangerous I agree because
it's easy to abuse.
> Would using irq_count() work? If so, that would fix this up.
There's nothing that works reliably to detect spinlocks on non
preempt kernels.
-Andi
--
ak@linux•intel.com -- Speaking for myself only.
next prev parent reply other threads:[~2009-01-31 5:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200901280010.37633.roger.larsson@e-gatan.se>
2009-01-28 12:18 ` PROBLEM: in_atomic() misuse all over the place Andi Kleen
2009-01-31 0:03 ` Andrew Morton
2009-01-31 5:55 ` Andi Kleen [this message]
2009-01-31 5:49 ` Andrew Morton
2009-01-31 8:48 ` David Miller
2009-01-31 8:58 ` Andrew Morton
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=20090131055508.GD18453@one.firstfloor.org \
--to=andi@firstfloor$(echo .)org \
--cc=akpm@linux-foundation$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mingo@elte$(echo .)hu \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pavel@ucw$(echo .)cz \
--cc=rml@tech9$(echo .)net \
--cc=roger.larsson@e-gatan$(echo .)se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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