I have a simple pipe test sitting on origin/failing-pipetest that periodically dies with a page fault. It should always run to completion.
—
Reply to this email directly or view it on GitHub.![]()
It turns out, it wasn't the pipes, but the fact that I was using fork() without an exec(), which is slightly broken on Akaros. The gist of the problem is that child processes are not able to properly handle syscalls that do not complete immediately (i.e. when a kthread is put to sleep on a rendez and returns to userspace with SC_DONE == 0). I noticed the problem because I was page faulting in the child as an early SCP, but the parent was clearly already a normal SCP (so the child should have been as well). This info is stored in procdata, and is not currently being copied over to a forked process properly.
This is a result of not properly keeping our fork() code up to date with additions to procinfo/procdata that affect forked processes.
I have a fix I am putting together that copies relevant portions of procinfo and procdata into a forked process, and then resets them properly if we happen to do an exec later. I will push it out for review soon.
--
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Related (almost) question. Is there any plan to support COW on fork?
--
I have actually never measured the cost of a "dumb" (as in, copy/split the whole VM before syscall exit) fork WRT a COW-enabled one.My guess is yes, it matters quite a bit in most cases.If both parent and child are going to have a long life, and ultimately write every single page in their VM space, then actually the overall cost of COW is higher WRT the dumb fork. There is extra cost per page with COW (taking fault, figuring out things, setup PTEs, and memcpy()).But, such cost would be diluted over the processes lifetime, and not paid upfront. Which might result in a better behavior for the caller in terms of latency.Then there is the most common case, fork+exec, for which the dumb fork is a total waste, as what you copied in the child, will be thrown away 100ns later.There are also secondary issues. Think a process with huge VM footprint like search.Now, search is unlikely to be doing any fork, but if it does, and fork tries to double up all its physical pages at syscall time, you may get into OOM pretty quickly.Having a Win32 CreateProcess() equivalent will be helpful to optimize the fork+exec case, though, apps will have to be rewritten for that.Now, if g3 has an equivalent for that, and most g3 apps we plan to port, use it, the task can become easier.
Closed #17.