kvm/amd64: don't limit a number of VCPU-s by GOMAXPROCS

We see some performance degradation after e98016263b
where we started limit a number of vcpu-s.

The memory limit for TestMemLimit is increased from 50MB to 128MB.
It is required because more vcpu-s require more memory. Before this
change, the test container required 46MB (8 vcpus). After this change,
the test container requires 60MB (328 vcpu-s).

PiperOrigin-RevId: 428879037
This commit is contained in:
Andrei Vagin
2022-02-15 14:42:17 -08:00
committed by gVisor bot
parent 90f7a066e3
commit 1012b95b22
2 changed files with 1 additions and 6 deletions
-5
View File
@@ -21,7 +21,6 @@ import (
"fmt"
"math/big"
"reflect"
"runtime"
"runtime/debug"
"golang.org/x/sys/unix"
@@ -489,10 +488,6 @@ func (m *machine) getMaxVCPU() {
} else {
m.maxVCPUs = int(maxVCPUs)
}
rCPUs := runtime.GOMAXPROCS(0)
if rCPUs < m.maxVCPUs {
m.maxVCPUs = rCPUs
}
}
func archPhysicalRegions(physicalRegions []physicalRegion) []physicalRegion {
+1 -1
View File
@@ -295,7 +295,7 @@ func TestMemLimit(t *testing.T) {
d := dockerutil.MakeContainer(ctx, t)
defer d.CleanUp(ctx)
allocMemoryKb := 50 * 1024
allocMemoryKb := 128 * 1024
opts := dockerutil.RunOpts{
Image: "basic/alpine",
Memory: allocMemoryKb * 1024, // In bytes.