Linux: copy-on-write of the operating system

If you want to learn Linux in order, the entry is here: Linux: Directory Index

1. Information contained in the PCB

(1) If you do not understand the content of the PCB, move to:

Linux: Process Control Block PCB

(2) The location of the PCB in the memory:

write picture description here

2. The role of MMU

(1) If you don't know about MMU, move to:

Linux: Memory Management Unit MMU

(2) The second role of MMU:

MMU decides whether a block of memory is allowed to read or write

3. Copy-on-write

(1) When the content of the right part of the MMU is read-only and not written, the physical addresses mapped in the data area and code area of ​​the fork child process are the same as those of the parent process
write picture description here
(2) When the content of the right part of the MMU is read-write ( That is, when the data is changed), the child process of fork will use a new physical memory for storage, that is, the physical address of the virtual memory map of the data is different from that of the parent process.
write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324661153&siteId=291194637