[HN Gopher] Process Creation in Io_uring
       ___________________________________________________________________
        
       Process Creation in Io_uring
        
       Author : semiquaver
       Score  : 22 points
       Date   : 2024-12-20 15:23 UTC (7 hours ago)
        
 (HTM) web link (lwn.net)
 (TXT) w3m dump (lwn.net)
        
       | cperciva wrote:
       | The "clone the entire address space and then call exec" idiom is
       | indeed wildly inefficient -- that's why the horror which is vfork
       | was invented -- but I'm not convinced that putting everything
       | which sits between fork and execve into io_uring (or, as a
       | comment snarkily suggests, ebpf) is the solution. There's just
       | too many things userland might want to do.
       | 
       | I wonder if the best solution lies somewhere in the vicinity of
       | "fork but only copy a small part of the address space" -- rather
       | than copying the entire address space as in fork (only to use a
       | tiny portion and throw away the rest) or copying none of the
       | address space as in vfork (the paging tables are shared between
       | parent and child until exec) if we can identify what memory the
       | child will need to access before calling _exit or exec (say, "the
       | current function and its local variables") then we could create
       | an address space with just a few paging tables entries.
       | 
       | Kind of like the "zygote" forking model (early in the main
       | process lifetime, a zygote process gets forked off, and when the
       | main process wants another worker it asks the zygote to fork one
       | off) except that the "zygote" is more like an induced pluripotent
       | stem cell, having been reverted from an adult state.
        
       ___________________________________________________________________
       (page generated 2024-12-20 23:00 UTC)