summaryrefslogtreecommitdiffhomepage
path: root/pkg/usermem/addr.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-10-09 13:21:14 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-09 13:23:30 -0700
commit6bbf66227136a29cd8e2f51166216b9a70fdfae5 (patch)
treec0d505a9bc26d34f8434998ae64fd81474abc106 /pkg/usermem/addr.go
parent46e168b5a00bd85f3739bac6f185c3bdc39dfa37 (diff)
Reduce the cost of sysinfo(2).
- sysinfo(2) does not actually require a fine-grained breakdown of memory usage. Accordingly, instead of calling pgalloc.MemoryFile.UpdateUsage() to update the sentry's fine-grained memory accounting snapshot, just use pgalloc.MemoryFile.TotalUsage() (which is a single fstat(), and therefore far cheaper). - Use the number of threads in the root PID namespace (i.e. globally) rather than in the task's PID namespace for consistency with Linux (which just reads global variable nr_threads), and add a new method to kernel.PIDNamespace to allow this to be read directly from an underlying map rather than requiring the allocation and population of an intermediate slice. PiperOrigin-RevId: 336353100
Diffstat (limited to 'pkg/usermem/addr.go')
0 files changed, 0 insertions, 0 deletions