Timeline for Is copy-on-write not implemented based on page fault?
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 20, 2021 at 0:15 | comment | added | forest |
The malloc() function, at least in glibc, also uses mmap() for larger requests. Also, I was under the impression that the pages were marked read only and pointed to the zero page, and only write attempts resulted in a context switch and the kernel doing its CoW magic. Is that wrong?
|
|
| Oct 16, 2018 at 18:17 | comment | added | Stephen Kitt |
“Copy on write” copies pages when they’re written to. exec() doesn’t copy anything. I’m not sure it needs any page faults at all (beyond the usual faulting mechanism used to read files).
|
|
| Oct 16, 2018 at 18:13 | comment | added | Tim | I just followed "copy on write". What would you call it? | |
| Oct 16, 2018 at 18:02 | comment | added | Stephen Kitt |
What gets copied by exec()?
|
|
| Oct 16, 2018 at 17:41 | comment | added | Tim | Here is what I meant by "copy on exec()": A process vfork() a child, then the child exec(), and exec() will allocate new space for the child. Is it correct that "copy on exec()" is not based on page fault, because exec() does the "copy" by itself without need of page fault handling? | |
| Oct 16, 2018 at 7:30 | comment | added | Stephen Kitt |
See my updated. Regarding “copy on exec()”, I’m not sure what you mean; could you clarify your question?
|
|
| Oct 16, 2018 at 7:29 | history | edited | Stephen Kitt | CC BY-SA 4.0 |
Explain allocation behaviour in more detail.
|
| Oct 16, 2018 at 1:13 | vote | accept | Tim | ||
| Oct 16, 2018 at 1:03 | comment | added | Tim | In the case of vfork(), is the "copy on exec()" (as opposed to "copy on write") also based on page fault? (I guess no, exec() does the copy by itself without need of page fault handling.) | |
| Oct 15, 2018 at 22:04 | comment | added | Tim | Thanks. When calling malloc(), how is the page table updated to the virtual address returned by the function? The virtual address can't be mapped to a physical memory address. Is the virtual address mapped to "null" or some other value, so that page fault can happen when access that virtual address? | |
| Oct 15, 2018 at 18:25 | history | edited | Stephen Kitt | CC BY-SA 4.0 |
Clarify the “yes” in the first part.
|
| Oct 15, 2018 at 17:44 | comment | added | Tim | Thanks. "“copied” pages are marked read-only. When a process tries to write to them, the CPU faults". Are the CPU faults page fault exception? Are they handled by the page fault service routine? | |
| Oct 15, 2018 at 17:40 | history | answered | Stephen Kitt | CC BY-SA 4.0 |