2005-09-27 17:40:45

by mailarch

[permalink] [raw]
Subject: 128 kbytes allocation limit for kmalloc?

Hello,

is it possible to allocate more than 128 kbytes in a kernel lkm module?
When I allocate more than 128 kbytes with the kmalloc call, kmalloc returns NULL.

--
Best regards,
Stephan Ferraro
NOOFS Core Developper
http://www.noofs.org/


2005-09-27 17:48:23

by Brian Gerst

[permalink] [raw]
Subject: Re: 128 kbytes allocation limit for kmalloc?

[email protected] wrote:
> Hello,
>
> is it possible to allocate more than 128 kbytes in a kernel lkm module?
> When I allocate more than 128 kbytes with the kmalloc call, kmalloc returns NULL.
>

No. Use vmalloc(). Keep in mind that kernel memory is a limited
resource, so don't use more memory that you really have to.

--
Brian Gerst

2005-09-28 12:55:12

by Hagen Paul Pfeifer

[permalink] [raw]
Subject: Re: 128 kbytes allocation limit for kmalloc?

* [email protected] | 2005-09-27 19:40:32 [+0200]:

>Hello,
>
>is it possible to allocate more than 128 kbytes in a kernel lkm module?

Yes, multiple kmalloc calls. You can implement your own memory managment
in top of it. For further informations: cat /proc/slabinfo

>When I allocate more than 128 kbytes with the kmalloc call, kmalloc returns NULL.

If you need one continues chunk of memory you must take vmalloc. But
note the performance penalty and some other disadvantages (dma, ...).

HGN

--
Standards are industry's way of codifying obsolescence.