All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <clameter@sgi.com>,
	kamalesh@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	bunk@kernel.org, apw@shadowen.org, balbir@linux.vnet.ibm.com
Subject: Re: Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc_that_much
Date: Tue, 8 Jan 2008 16:14:53 +0530	[thread overview]
Message-ID: <20080108104453.GA20386@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080108105609.197a2874@hyperion.delvare>

On Tue, Jan 08, 2008 at 10:56:09AM +0100, Jean Delvare wrote:
> Hi Andrew, hi Chritoph,
> 
> On Mon, 7 Jan 2008 11:38:31 -0800, Andrew Morton wrote:
> > On Mon, 7 Jan 2008 10:31:53 -0800 (PST)
> > Christoph Lameter <clameter@sgi.com> wrote:
> > 
> > > On Mon, 7 Jan 2008, Andrew Morton wrote:
> > > 
> > > > > : undefined reference to `__you_cannot_kmalloc_that_much'
> > > 
> > > There is also a kernel.org bugzilla for this at
> > > 
> > > http://bugzilla.kernel.org/show_bug.cgi?id=9669
> > > For some reason my adds to this do not show up.
> > > 
> > > In both cases we have a 
> > > 
> > > k(z/m)alloc(sizeof(*pointer), ...)
> > > 
> > > that is for some reason failing. I guess what happens is that the function 
> > > in which this occurs is too complex for gcc 3.2. Thus it stops constant 
> > > folding the sizeof(*pointer) in the complex inline-if-cascade that SLAB 
> > > needs to determine the cache and does not eliminate the 
> > > __you_cannot_kmalloc_that_much branch().
> 
> Interesting theory... So I tried to split half of the code of
> dmi_id_init() to a subfunction and bingo! gcc 3.2.3 is now able to
> build it properly. Thanks for the hint!
> 
> > > SLUB in that case just puts a series of if comparisions in the code. This 
> > > means compilation does not fail but a large amount of code is generated.
> > 
> > ug.  Silent and nasty.
> > 
> > > We could replace the __you_cannot_kmalloc_that_much() with a BUG() 
> > > statement so we have the same effect in SLAB?
> > 
> > I think it'd be better to just put suitable workarounds at the offending
> > callsites.  We've only seen three or four of them in several months.
> 
> Here's a workaround for dmi-id.
> 
> Subject: Fix for __you_cannot_kmalloc_that_much failure in dmi-id
> 
> gcc 3.2 has a hard time coping with the code in dmi_id_init():
> 
> drivers/built-in.o(.init.text+0x789e): In function `dmi_id_init':
> : undefined reference to `__you_cannot_kmalloc_that_much'
> make: *** [.tmp_vmlinux1] Error 1
> 
> Moving half of the code to a separate function seems to help. This is
> a no-op for gcc 4.1 which will successfully inline the code anyway.

Hi Jean,

Thank you, I have tested the patch, it fixes the build failure.


 Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
 Signed-off-by: Jean Delvare <khali@linux-fr.org>
 ---
 drivers/firmware/dmi-id.c |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
 
--- linux-2.6.24-rc7.orig/drivers/firmware/dmi-id.c	2007-10-24 09:59:28.000000000 +0200
+++ linux-2.6.24-rc7/drivers/firmware/dmi-id.c	2008-01-08 10:32:00.000000000 +0100
@@ -175,12 +175,11 @@ static struct device *dmi_dev;

 extern int dmi_available;

-static int __init dmi_id_init(void)
+/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
+   dmi_id_init! */
+static void __init dmi_id_init_attr_table(void)
 {
-	int ret, i;
-
-	if (!dmi_available)
-		return -ENODEV;
+	int i;
 
 	/* Not necessarily all DMI fields are available on all
 	 * systems, hence let's built an attribute table of just
@@ -205,6 +204,16 @@ static int __init dmi_id_init(void)
 	ADD_DMI_ATTR(chassis_serial,    DMI_CHASSIS_SERIAL);
 	ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG);
 	sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr;
+}
+
+static int __init dmi_id_init(void)
+{
+	int ret;
+
+	if (!dmi_available)
+		return -ENODEV;
+
+	dmi_id_init_attr_table();

 	ret = class_register(&dmi_class);
 	if (ret)

I'll now check if I can do something similar for snd-mixer-oss.
 
-- 
Jean Delvare

  reply	other threads:[~2008-01-08 10:48 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-06 22:19 Linux 2.6.24-rc7 Linus Torvalds
2008-01-06 23:52 ` Mark Lord
2008-01-07  0:08   ` Linus Torvalds
2008-01-07  0:35     ` Tejun Heo
2008-01-07  8:48 ` Linux 2.6.24-rc7 Build Failure on headers_install Kamalesh Babulal
2008-01-07 10:12   ` Sam Ravnborg
2008-01-08 10:51     ` Kamalesh Babulal
2008-01-08 13:10       ` Sam Ravnborg
2008-01-07 10:36 ` Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc_that_much Kamalesh Babulal
2008-01-07 18:07   ` Andrew Morton
2008-01-07 18:31     ` Christoph Lameter
2008-01-07 19:38       ` Andrew Morton
2008-01-08  9:56         ` Jean Delvare
2008-01-08 10:44           ` Kamalesh Babulal [this message]
2008-01-08 12:34           ` Fix for __you_cannot_kmalloc_that_much failure with gcc 3.2 Jean Delvare
2008-01-08  4:20       ` Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc_that_much Arjan van de Ven
2008-01-08  5:23         ` Christoph Lameter
2008-01-08  8:20     ` Kamalesh Babulal
2008-01-08  9:27       ` Balbir Singh
2008-01-08  7:48   ` Jean Delvare
2008-01-07 12:13 ` Linux 2.6.24-rc7 kernel BUG at kernel/sched.c:5156! Kamalesh Babulal
2008-01-08 16:16   ` [powerpc crash] " Ingo Molnar
2008-01-07 15:53 ` Linux 2.6.24-rc7 Alejandro Riveira Fernández
2008-01-07 16:27   ` smpboot_64 section mismatch warning Sam Ravnborg
2008-01-07 23:27     ` David Howells
2008-01-08  9:14       ` Alejandro Riveira Fernández
2008-01-08 11:17     ` David Howells
2008-01-07 16:31   ` section mismatch warning in head_64.S Sam Ravnborg
2008-01-15 10:18     ` Alejandro Riveira Fernández
2008-01-07 16:14 ` Linux 2.6.24-rc7 Alejandro Riveira Fernández
2008-01-07 16:14   ` Alejandro Riveira Fernández
2008-01-07 16:24   ` Michael Buesch
2008-01-07 16:24     ` Michael Buesch
2008-01-07 16:52     ` Alejandro Riveira Fernández
2008-01-07 16:52       ` Alejandro Riveira Fernández
2008-01-07 17:30       ` Michael Buesch
2008-01-07 17:30         ` Michael Buesch
2008-01-07 20:23         ` Alejandro Riveira Fernández
2008-01-07 20:23           ` Alejandro Riveira Fernández
2008-01-08 15:30           ` Michael Buesch
2008-01-08 15:30             ` Michael Buesch
2008-01-08 15:55             ` Alejandro Riveira Fernández
2008-01-08 15:55               ` Alejandro Riveira Fernández
2008-01-24 20:27             ` Linus Torvalds
2008-01-24 21:07               ` John W. Linville
2008-01-24 21:34                 ` Linus Torvalds
2008-01-25 12:29                   ` Johannes Berg
2008-01-25 16:08                     ` Linus Torvalds
2008-01-25 16:23                       ` Michael Buesch
2008-01-25 16:43                         ` Linus Torvalds
2008-01-25 17:27                           ` Dan Williams
2008-01-25 17:38                             ` Linus Torvalds
2008-01-25 17:42                               ` Dan Williams
2008-02-05 20:55                                 ` Russell S. Senior
2008-01-25 18:22                               ` Linus Torvalds
2008-01-25 18:30                                 ` Michael Buesch
2008-01-25 19:07                                   ` Linus Torvalds
2008-01-25 19:34                                     ` Michael Buesch
2008-01-25 19:48                                     ` John W. Linville
2008-01-25 19:50                                       ` John W. Linville
2008-01-25 21:18                                         ` John W. Linville
2008-01-25 21:56                                           ` Linus Torvalds
2008-01-25 22:46                                             ` John W. Linville
2008-01-25 23:20                                               ` Guy Cohen
2008-01-26 13:53                                               ` David Miller
2008-01-26 13:47                                             ` David Miller
2008-01-25 22:02                                           ` Guy Cohen
2008-01-26 13:40                                           ` David Miller
2008-01-25 20:28                                       ` Linus Torvalds
2008-01-26 13:37                                         ` David Miller
2008-01-27  6:32                                           ` Linus Torvalds
2008-01-27  7:16                                             ` Jeff Garzik
2008-01-27  7:24                                               ` David Miller
2008-01-27  7:54                                                 ` Linus Torvalds
2008-01-28  3:15                                                   ` David Miller
2008-01-25 23:22                                     ` Jeff Garzik
2008-01-26 13:27                                     ` David Miller
2008-01-27  6:25                                       ` Linus Torvalds
2008-01-26 13:22                                 ` David Miller
2008-01-25 18:21                           ` Michael Buesch
2008-01-25 18:34                             ` Linus Torvalds
2008-01-25 18:41                               ` Michael Buesch
2008-01-25 21:11                                 ` Inaky Perez-Gonzalez
2008-01-25 21:21                                   ` Michael Buesch
2008-01-25 21:28                                     ` Inaky Perez-Gonzalez
2008-01-26 13:42                                       ` David Miller
2008-01-27  2:26                                         ` Luis R. Rodriguez
2008-01-29 19:07                                         ` Inaky Perez-Gonzalez
2008-01-25 21:46                                     ` John W. Linville
2008-01-25 22:15                                       ` Michael Buesch
2008-01-25 22:34                                       ` Tomas Winkler
2008-01-26 13:49                                       ` David Miller
2008-01-25 21:46                                     ` Guy Cohen
2008-01-25 21:54                                     ` Linus Torvalds
2008-01-26 13:46                                       ` David Miller
2008-01-25 18:34                             ` John W. Linville
2008-01-24 22:17               ` Michael Buesch
2008-01-24 22:26                 ` Linus Torvalds
2008-01-24 22:33                   ` Michael Buesch
2008-01-08  0:50 ` J.A. Magallón
2008-01-09  1:32   ` Avuton Olrich
2008-01-09  1:56   ` Tejun Heo
2008-01-10  9:25     ` J.A. Magallón
2008-01-10 13:10       ` Tejun Heo
2008-01-13 23:19         ` J.A. Magallón
2008-01-13 23:57           ` Tejun Heo
2008-01-14 23:38             ` J.A. Magallón
2008-01-14 23:56               ` Tejun Heo
2008-01-08 18:42 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Mariusz Kozlowski
2008-01-08 18:42   ` Mariusz Kozlowski
2008-01-08 21:00   ` Linux 2.6.24-rc7: sparc64: WARNING: at Randy Dunlap
2008-01-08 21:00     ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Randy Dunlap
2008-01-08 22:39     ` Mariusz Kozlowski
2008-01-08 22:39       ` Mariusz Kozlowski
2008-01-08 22:45       ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 Randy Dunlap
2008-01-08 22:45         ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Randy Dunlap
2008-01-09 16:31         ` Mariusz Kozlowski
2008-01-09 16:31           ` Mariusz Kozlowski
2008-01-08 22:50   ` Linux 2.6.24-rc7: sparc64: WARNING: at David Miller
2008-01-08 22:50     ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() David Miller
2008-01-08 22:56     ` Linux 2.6.24-rc7: sparc64: WARNING: at Ingo Molnar
2008-01-08 22:56       ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Ingo Molnar
2008-01-08 23:06       ` Linux 2.6.24-rc7: sparc64: WARNING: at David Miller
2008-01-08 23:06         ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() David Miller
2008-01-09  0:52         ` Linux 2.6.24-rc7: sparc64: WARNING: at Ingo Molnar
2008-01-09  0:52           ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Ingo Molnar
2008-01-09  1:17 ` Linux 2.6.24-rc7 Willy Tarreau

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=20080108104453.GA20386@linux.vnet.ibm.com \
    --to=kamalesh@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=bunk@kernel.org \
    --cc=clameter@sgi.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.