Add address_space_id parameter to futex wait/wake for multi-process support#759
Add address_space_id parameter to futex wait/wake for multi-process support#759
Conversation
…upport Add address_space_id: u64 discriminator to FutexEntry, bucket hashing, wait(), and wake() to prevent false aliasing between processes with overlapping virtual address ranges. On userland (non-overlapping VA partitions) callers pass 0. Update all shim callers and tests.
|
🤖 SemverChecks 🤖 Click for details |
jaybosamiya-ms
left a comment
There was a problem hiding this comment.
Private or not is more of a performance optimization for Linux at least, I am not entirely convinced that we even need the "same virtual address in different address spaces": what is the concrete scenario this comes up, and not having this address_space_id leads to incorrect behavior?
Furthermore, if we need to have an address_space_id somehow, then I am not so sure of the specific types/design used here. Specifically, u64 + opaque kinda leads to a design where it is easy to get things wrong. If we really need it, we probably need a more fleshed out process abstraction for LiteBox, and then this should probably be referring to address spaces from that abstraction. For now, this seems like overfitting some particular design, but the design itself is unclear.
A couple more concrete questions (if we are going this route): is address_space_id meant to be one value assigned from each process? How is the opaque value meant to be picked up (i.e., where is it meant to come from)? Any particular reason we are not using a process identifier instead of an address_space_id? Additionally, in terms of the parameter space, do we expect 64-bits of such identifiers to be used? What is the guidance for single-process shims? etc.
Oh, and (if we are going this exact route) each of the places in the shim where 0s have been added in, those should be documented as places we intend to change once the other bits of this are figured out. A proper abstraction would not have this issue I think.
Summary
address_space_id: u64discriminator toFutexEntry, bucket hashing,wait(), andwake()to prevent false aliasing between processes with overlapping virtual address ranges.0.Split from #743.