-   Linux - Kernel (
-   -   Linux kernel memory questions / limitations (

kd2000 03-26-2010 04:35 PM

Linux kernel memory questions / limitations

I am somewhat of a newbie to Linux apps / kernel / driver programming.
I have question related to kernel memory allocation which I am not able to clearly find an answer. I have Google'd around and found lot of incomplete threads without any solution. Here is what I have -
For x86_64 - Nehalem CPU 64 bit mode, I have a system with 6GB memory, with a PCIe device capable of performing 64 bit DMA.
I want to allocate 2GB or more of DMA memory via a kernel lkm module. Basically idea is to make memory allocation kernel aware.

1> Can the DMA memory beyond 4G address space be allocated by kernel ?
Are there any limitations with 2.6.x ?

2> I have a sample LKM which via an ioctl allocates memory using get_free_page, however after allocating around 65xxx pages (~256MB), the kernel OOM kicks in and kills the user process ? Is there a config anywhere to prevent his ? Is the user space process limited to certain amount memory ?

3> This is 64 bit mode kernel so technically there should be no restrictions right ? I am also aware about some of the allocate_bootmem options, but not quite clear on their usage for address space beyond 4Gb. Is this only choice ? What about DMA coherency ?

Thanks a bunch in advance.

syg00 03-26-2010 10:45 PM

The 4 Gig virtual address space is only relevant for 32-bit x86 - x86_64 has no concept of this. Zones still exist, but they are different; and of course bigger.
Are you using GFP_DMA32 ?

smeezekitty 03-28-2010 09:05 PM

The pages are 64GB and not 4GB on 64bit.

Brawn 05-18-2010 01:15 AM

Hello, sorry for jumping into the conversation but this posting is the closest I got to the answer I need.
Question: Does Ubuntu 10 or Fedora 12/13 32bit support 4gb RAM?

And yes I am a newbie; Need to install Linux because I need to stay legal :)

Thank you for your support.

TheIndependentAquarius 05-18-2010 01:23 AM

Hi Brawn,

Have a look at the following thread:

syg00 05-18-2010 02:44 AM

Short answer - yes.
I would be surprised if Fedora even offered a PAE kernel these days. I would expect the default kernel to have all that support compiled in.

All times are GMT -5. The time now is 12:16 PM.