jserv/xv6-x86_64

Implement copy-on-write fork

Opened this issue · 0 comments

jserv commented

With a technique called copy-on-write (COW), when a fork occurs, the parent process's pages are not copied for the child process. Instead, the pages are shared between the child and the parent process. Whenever a process (parent or child) modifies a page, a separate copy of that particular page alone is made for that process (parent or child) which performed the modification. This process will then use the newly copied page rather than the shared one in all future references. The other process (the one which did not modify the shared page) continues to use the original copy of the page (which is now no longer shared). This technique is called copy-on-write since the page is copied when some process writes to it.

Initial implementation: https://github.com/delphifirst/xv6/commits/master