lkml.org 
[lkml]   [2001]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Hi.... I guess linux-kernel..
Date
> I want to know, how use continuous memory over 128k at linux kernel...
> kmalloc is 128k limit...
> But, I want continous memory over 128k at linux kernel...

kmalloc() returns physically contiguous regions of memory. The 128KB limit
exists because it is difficult to find a free memory block that large in a
running system, due to fragmentation.

You have two options - if you can use a virtually (but not physically)
contiguous region of memory, use vmalloc(). This works fine for kernel data
structures. If you are using the memory as a DMA buffer however, you need to
be aware that the pages are not physically contiguous, so you have to DMA
each page individually (scatter/gather). Also for DMA to 32-bit PCI devices,
use vmalloc_32() instead of vmalloc() (which might give you high-memory
pages that are inaccessible to 32-bit devices).

The second option is to grab a large physically-contiguous region of memory
at boot time. There are a few kernel patches available that provide this
feature, although I haven't used them. For a really quick hack, you can use
the "mem=xxxM" boot-time option to tell the kernel to use less physical
memory than you actually have, and then claim the remaining memory for your
own use.

Regards,
Dan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.032 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site