On Fri, Nov 5, 2021 at 9:19 AM Thomas Munro <[email protected]> wrote: > On Tue, Oct 26, 2021 at 11:29 PM Thomas Munro <[email protected]> wrote: > > When I do mmap(MAP_ANONYMOUS | MAP_SHARED) and then fork(), it seems > > that futex(2) wakeups are not delivered between child and parent in > > that memory. It does work as expected if I instead use > > shmget(IPC_PRIVATE).
> This seems to be because such memory objects have no uvm_obj, which is > needed by futex_get() to identify futexes. Could they have one? Or > perhaps there is some other way to make a futex key in this case? Thanks very much to kettenis@ for fixing this! One other observation about this implementation (this may already be on a to-do list somewhere, in which case please count this as +1 vote): instead of a single ftlock and ftlist_shared pair, you could hash the futex key to select among N locked lists, to avoid contention (like FreeBSD).

