Process memory space-general Linux technology-Linux programming and kernel information. The following is a detailed description. The Linux operating system uses virtual memory management technology, so that each process has a process address space that does not interfere with each other. This space is a linear virtual space with a block size of 4 GB. The virtual address is displayed and accessed by the user, and the actual physical memory address cannot be viewed. Using this virtual address can not only protect the Operating System (users cannot directly access the physical memory), but more importantly, the user program can use a larger address space than the actual physical memory (For details, refer to the hardware basics ).
Before discussing process space details, we need to clarify the following questions:
1. 4G process address space is divided into two parts manually: user space and kernel space. The user space ranges from 0 to 3 GB (0xC0000000), and the kernel space occupies 3 GB to 4 GB. Generally, a user process can only access the virtual address of the user space, but cannot access the virtual address of the kernel space. You can access the kernel space only when the user process calls the system (representing that the user process is executed in the kernel state.
Second, the user space corresponds to the process, so whenever the process is switched, the user space will change. The kernel space is mapped by the kernel, which will not change with the process and is fixed. The kernel space address has its own page table (init_mm.pgd), and user processes have different page tables.
Third, the user space of each process is completely independent and irrelevant.
Question: 1. Does the 4G linear virtual space mean that the system allocates physical memory to each process or does the system virtualize the physical memory into 4 GB?
2. Users in 4G accounts for 0 to 3G, and the kernel accounts for 3G to 4G. Is the Kernel used to control the running process and provide the kernel of the running environment, or the entire kernel?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.