Repository navigation
Move pinring to its own sidecar binary rather than the gofer. - #14546
EtiennePerot wants to merge 1 commit into
Conversation
ayushr2
left a comment
There was a problem hiding this comment.
LGTM. Honestly, I didn't review fdparking.c too well since I can't verify that level of assembly code on the top of my head. But I trust you've done a good job at it and it's agent reviewed.
But it seems a bit overly complex. We're writing assembly code for invoking syscalls and there's micro optimizations like the entire park_stack thing. Quite complex. The entire slim() hackery is quite something deep as well. I assume it's needed for the process memory footprint to be lower? But I wonder how much we save here. Is all this needed to not regress our benchmarks? If not, then we'd benefit with lesser/simpler code than these optimizations. Will leave it up to you.
I take comfort in the facts that:
Other runtimes benchmark themselves in single-digit megabytes of memory overhead, which is a resolution where every 4KiB page matters :) |
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced by PR gvisor#13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes).
e3ffc8d to
5bcb81d
Compare
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). FUTURE_COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 976115235
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981. This instead moves the job of holding the ring to a separate tiny C sidecar binary (`runsc-fd-parking`, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible. Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes). COPYBARA_INTEGRATE_REVIEW=#14546 from EtiennePerot:pinring-sidecar e3ffc8d PiperOrigin-RevId: 980553731
|
This was merged. |
Previously, the ring was held by the gofer, which works well for the case where the gofer is 1-to-1 with the Sentry. This isn't true for multi-container sandboxes (where the current approach means we wait 500ms for each container doing nothing on exit), and it's also not going to work well with the no-root-container mode introduced in PR #13981.
This instead moves the job of holding the ring to a separate tiny C sidecar binary (
runsc-fd-parking, named such to make its purpose obvious in the process table). Because this sidecar binary's job is very unimportant during startup, it defers as much of its work as possible, and because it must run for the whole lifetime of the sandbox, it minimizes its own memory footprint as aggressively as possible.Benchmarks show no measurable startup or teardown latency regression, and a +52KiB memory cost per sandbox (i.e. ~5.2 MiB per 100 sandboxes).