Files
Etienne PerotandgVisor bot 0a86482f45 Shave ~150ms off gVisor startup by making host membarrier lazy + async.
Host membarrier support lookup and registation used to run as part of `init`
for the `hostmm` package. Due to `runsc` being a monolithic binary, this
executes unconditionally several times during the sandbox startup process.

This change skips this process for all `runsc` invocations that don't need
it by moving it to the Platform constructors, and makes initialization
itself async because the `MEMBARRIER_CMD_PRIVATE_EXPEDITED` probe can take
tens of milliseconds by itself.

Benchmarks:

```
# Plain Docker, Systrap in a VM, running just
# `docker run --runtime=runsc --rm alpine true`:
                 │    before    │                after                │
                 │     sec      │     sec      vs base                │
DockerRunBinTrue    836.5m ± 4%   674.6m ± 4%  -19.35% (p=0.000 n=16)

# Kubernetes with containerd, measuring time-to-first-log latency
# minus Kubernetes scheduling overhead:
        │          before          │                      after                       │
        │ totalruntimeinit-min-sec │ totalruntimeinit-min-sec  vs base                │
StartUp               1083.7m ± 2%                943.9m ± 3%  -12.91% (p=0.000 n=16)

        │          before          │                      after                       │

        │          before          │                      after                       │
        │ totalruntimeinit-p50-sec │ totalruntimeinit-p50-sec  vs base                │
StartUp               1083.7m ± 2%                943.9m ± 3%  -12.91% (p=0.000 n=16)

        │          before          │                      after                       │
        │ totalruntimeinit-p95-sec │ totalruntimeinit-p95-sec  vs base                │
StartUp               1083.7m ± 2%                943.9m ± 3%  -12.91% (p=0.000 n=16)
```

PiperOrigin-RevId: 947382582
2026-07-13 19:45:54 -07:00
..