Skip to contentSkip to conversation

__you_cannot_kmalloc_that_much

DISCUSSION Luck, Tony 2 participants 4 messages Jun 19, 2003

lore
Share & tools
lore

Luck, Tony

author
#0 lore raw

While trying to compile the latest pull from the lia64.bkbits.net:8080/linux-ia64-2.5 repository I hit the "you_cannot_kmalloc_that_much" message in the final link.

The culprit is in

drivers/usb/host/uhci-debug.c

which contains:

#define MAX_OUTPUT (PAGE_SIZE * 16)

	...

	up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL);

With the default 16k page size we are trying to allocate 256K of memory, which is bigger that the largest size pool in include/linux/kmalloc_sizes.h

Do we need a larger pool (I don't think so) or is this allocation excessive?

-Tony

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Tony

Tony> While trying to compile the latest pull from Tony> the lia64.bkbits.net:8080/linux-ia64-2.5 Tony> repository I hit the "you_cannot_kmalloc_that_much" Tony> message in the final link.

Tony> The culprit is in

Tony> drivers/usb/host/uhci-debug.c

Tony> which contains:

Tony> #define MAX_OUTPUT (PAGE_SIZE * 16)

Tony> ...

  up-> data = kmalloc(MAX_OUTPUT, GFP_KERNEL);

Tony> With the default 16k page size we are trying to Tony> allocate 256K of memory, which is bigger that the Tony> largest size pool in include/linux/kmalloc_sizes.h

Tony> Do we need a larger pool (I don't think so) or is Tony> this allocation excessive?

Clearly the latter. If it works with 4KB page size on x86, certainly we don't need 4 or 8 times more space on ia64.

Can you take this up directly with the author of the offending line?

Thanks,

	--david
author
#2 lore raw
In reply to Luck, Tony
Quoted 11 lines

Tony> #define MAX_OUTPUT (PAGE_SIZE * 16)

Tony> ...

  up-> data = kmalloc(MAX_OUTPUT, GFP_KERNEL);

Tony> With the default 16k page size we are trying to Tony> allocate 256K of memory, which is bigger that the Tony> largest size pool in include/linux/kmalloc_sizes.h

Quoted 7 lines

Tony> Do we need a larger pool (I don't think so) or is Tony> this allocation excessive?

Clearly the latter. If it works with 4KB page size on x86, certainly we don't need 4 or 8 times more space on ia64.

Can you take this up directly with the author of the offending line?

Ok, I sent an e-mail to Johannes Erdfelt (with a Cc: to the linux-usb-users mailing list) with a patch to switch the size to a fixed 64k.

But I'm still not out of the woods ... with this patch applied I get a:

undefined reference to `local symbols in discarded section .exit.text'

message. Is this related to the warning about using an old linker?

gcc: 3.2
as: GNU assembler version 2.13.90
ld: GNU ld version 2.13.90.0.2 20020802

-Tony

#3 lore raw
In reply to Luck, Tony
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Tony

Tony> undefined reference to `local symbols in discarded section .exit.text'

Tony> message. Is this related to the warning about using an old linker?

Not likely. It sounds like a driver is failing to use __exit_p() (see linux/init.h).

	--david