Re: Doubt regarding memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
hi all,

For a 32-bit machine, there is total 4GB of memory(Physiacl addresses). So
in that 1 GB for Kernel and 3GB for User Space.

Correct, assuming you're using 3:1 VM (virtual memory) split, that is 3GB for user space and 1GB for kernel space.
So, kernel won't access that 3GB of memory, right?
Kernel space has no problem accessing user space, but not the other way around. This is because of page protection.

All the kernel code is exist in 1 GB of memory.... CMIIW

Correct.
So, my doubt is  the DMA(0-16MB),NORMAL(16-896MB),HIGH(896MB-) memory
divided within this 4GB of memory ,right?

Not really, what you see above (the VM split) is in virtual address space, while memory zone splits the RAM physical address into different parts. For example, 0-16 MB is named as DMA zone because they are adddressable for DMA operation.

So, both has different context (virtual VS physical) although in practice they are connected since you will get free pages from those zones. But once you are speaking virtual address space, there is no zone. Zones are in physical addressing context.

if we allocate the pages using alloc_pages, from which region the pages are allocated for the kernel modules. is it from Physical RAM memory or from 1GB
of kernel space ??


It can be from any zone as requested, but normally IIRC it is from either normal or DMA zone. In some cases, to relieve pressure toward those two zones, requests can be satisfied from highmem zone (if there is such available, i.e on machine with RAM more than 896 MB in x86 32 bit).

Remember that request is always served by looking into free pages from RAM (physical context). And yes, if you bring the context into virtual addressing, it would be seems as being "satisfied" by looking into kernel space, but this is no more than just identity mapping comes to play.

PS: Sorry if I directly reply to your original post, since I think here I can understand what is your real confusion.

regards,

Mulyadi


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux