Re: [RFC PATCH 0/6] Introduce Copy-On-Write to Page Table

From: Matthew Wilcox
Date: Sat May 21 2022 - 16:13:38 EST


On Sat, May 21, 2022 at 06:07:27PM +0200, David Hildenbrand wrote:
> I'm missing the most important point: why do we care and why should we
> care to make our COW/fork implementation even more complicated?
>
> Yes, we might save some page tables and we might reduce the fork() time,
> however, which specific workload really benefits from this and why do we
> really care about that workload? Without even hearing about an example
> user in this cover letter (unless I missed it), I naturally wonder about
> relevance in practice.

As I get older (and crankier), I get less convinced that fork() is
really the right solution for implementing system(). I feel that a
better model is to create a process with zero threads, but have an fd
to it. Then manipulate the child process through its fd (eg mmap
ld.so, open new fds in that process's fdtable, etc). Closing the fd
launches a new thread in the process (ensuring nobody has an fd to a
running process, particularly one which is setuid).