From: Nick Piggin <npiggin@suse.de>
To: Valdis.Kletnieks@vt.edu
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, mm-commits@vger.kernel.org
Subject: Re: mmotm 2009-04-24-18-14 uploaded - NVidia indigestion
Date: Tue, 28 Apr 2009 08:15:57 +0200 [thread overview]
Message-ID: <20090428061557.GA29299@wotan.suse.de> (raw)
In-Reply-To: <57773.1240857915@turing-police.cc.vt.edu>
On Mon, Apr 27, 2009 at 02:45:15PM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Sat, 25 Apr 2009 07:24:34 +0200, Nick Piggin said:
>
> > > #include <linux/version.h>
> > > #include <linux/utsname.h>
> > > int main() {
> > > if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) {
> > > return 0;
> > > } else {
> > > return 1;
> > > }
>
> > Yeah BUILD_BUG_ON does work like that. I can't for the life of me
> > understand why it triggered though. Is anything in your external
> > code calling kmalloc_slab directly?
>
> See above - I didn't think LINUX_VERSION_CODE cared about kmalloc, but
> I could be wrong on this. ;)
>
> > What's the preprocessor output look like?
>
> The problem appears to be that if you only include version.h and utsname.h,
> and *don't* actually reference kmalloc_slab, it doesn't know that the size_t
> is actually a constant, so it whinges. Most modules end up doing at least
> one kmalloc(), so kmalloc() and kmalloc_slab() get inlined, the constant 'size'
> gets propogated, and life is good. If you *don't* call kmalloc(), bad things
> happen. ;)
Hmm, yes if you build without -O, then it appears like the compiler
trips over this. I wouldn't be unhappy with just removing the BUILD_BUG_ON,
but shouldn't the module be using -O[s2]?
next prev parent reply other threads:[~2009-04-28 6:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200904250133.n3P1XBJn006790@imap1.linux-foundation.org>
2009-04-25 3:06 ` Valdis.Kletnieks
2009-04-25 5:24 ` Nick Piggin
2009-04-27 18:45 ` Valdis.Kletnieks
2009-04-28 6:15 ` Nick Piggin [this message]
2009-04-28 16:01 ` Valdis.Kletnieks
2009-04-29 7:03 ` Nick Piggin
2009-04-30 10:36 ` Nick Piggin
2009-04-30 11:03 ` Pekka Enberg
2009-04-25 3:52 ` mmotm 2009-04-24-18-14 uploaded - pulseaudio causes BUG Valdis.Kletnieks
2009-04-25 4:41 ` 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=20090428061557.GA29299@wotan.suse.de \
--to=npiggin@suse.de \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@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
Powered by JetHome