2012/10/04

Linux Memory

Memory Map
http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory
Once virtual addresses are enabled, they apply to all software running in the machine, including the kernel itself.
In Linux, kernel space is constantly present and maps the same physical memory in all processes. Kernel code and data are always addressable, ready to handle interrupts or system calls at any time. By contrast, the mapping for the user-mode portion of the address space changes whenever a process switch happens.
It is also possible to create an anonymous memory mapping that does not correspond to any files, being used instead for program data. In Linux, if you request a large block of memory via malloc(), the C library will create such an anonymous mapping instead of using heap memory.
You can examine the memory areas in a Linux process by reading the file /proc/pid_of_process/maps.

http://duartes.org/gustavo/blog/post/how-the-kernel-manages-your-memory
http://duartes.org/gustavo/blog/post/page-cache-the-affair-between-memory-and-files


http://stackoverflow.com/questions/116343/what-is-the-difference-between-vmalloc-and-kmalloc
http://www.scs.ch/~frey/linux/memorymap.html


Memory Barrier
http://stackoverflow.com/questions/1787450/how-do-i-understand-read-memory-barriers-and-volatile
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0211i/Babfdddg.html
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka14041.html


Code of barrier for ARM
http://lxr.linux.no/#linux+v3.4.1/arch/arm/include/asm/barrier.h#L50

No comments:

Post a Comment

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...