From 9226ccb59f5967f5c784280b993711530615dcd7 Mon Sep 17 00:00:00 2001 From: Hironori Shiina Date: Thu, 11 Nov 2021 11:27:05 -0500 Subject: Enable 'podman run --memory-swappiness=0' '--memory-swappiness=0' used to work. This patch fixes the regression issue, which was caused by the change of infra container creation process. Signed-off-by: Hironori Shiina --- pkg/specgenutil/specgen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/specgenutil') diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index 4e8f954fb..04d3add32 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -172,7 +172,7 @@ func getMemoryLimits(s *specgen.SpecGenerator, c *entities.ContainerCreateOption memory.Kernel = &mk hasLimits = true } - if c.MemorySwappiness > 0 { + if c.MemorySwappiness >= 0 { swappiness := uint64(c.MemorySwappiness) memory.Swappiness = &swappiness hasLimits = true -- cgit v1.2.3-54-g00ecf