Re: Memory management questions

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

 



They do go through the paging mechanism. But there is a One-to-One mapping
between the virtual and physical addresses for the first 896MB of the kernel address
space(Virtual address range 0xC000000-0xF7FFFFFF is mapped to physical address
range 0x-37FFFFFF). Hence the physical addresses should be contiguous. That is
why those macros can be used instead of looking up the TLB or the page table.
For Virtual addresses that are above 896MB(F8000000 and above) in kernel
space, however the mapping is not one-to-one and has to go through the page table.
Take a look at vmalloc and temporary/permanent address mapping to learn more
about it.



HTH, Rithin.


Tyler wrote:


Ok so this means that the adresses used by the kernel don't go through the paging mechanism (PGD,PMD,PTE) ?

Raghu R. Arur wrote:

These functions are valid only for kernel memory and not for usre space memory.

On Sat, 12 Jun 2004, Tyler wrote:


Hi all,

I've always thinked that paging or virtual memory was practical to avoid memory fragmentation. I thinked that you can map contiguous virtual pages to non contiguous physical page frames.
But let's take a look at the macros __va(x) and __pa(x) :
#define __pa(x) ((unsigned long)x-PAGE_OFFSET)
#define __va(x) ((unsigned long)x+PAGE_OFFSET)
PAGE_OFFSET is a constant. For me, this means that virtual contiguous adresses have to be mapped to contiguous physical adresses. Am I wrong ?:)



-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/




-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


-- Rithin K Shetty Graduate Student (Computer Science) North Carolina State University Raleigh, NC Ph: (919)834-6782 Homepage: http://www4.ncsu.edu/~rkshetty



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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