From 4b7725203b1745ee413ca5968f562b77b3ac1239 Mon Sep 17 00:00:00 2001 From: xuxuepeng Date: Mon, 29 Apr 2024 06:20:39 +0800 Subject: [PATCH] Allow swappiness to be -1 as default Signed-off-by: xuxuepeng (cherry picked from commit ccfbf74810da05bfe42352343bc5125845bb8901) --- kata-containers.spec | 12 ++++++--- ...-Allow-swappiness-to-be-1-as-default.patch | 26 +++++++++++++++++++ series.conf | 1 + 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 patches/0006-Allow-swappiness-to-be-1-as-default.patch diff --git a/kata-containers.spec b/kata-containers.spec index abf65c7..2c5c0ef 100644 --- a/kata-containers.spec +++ b/kata-containers.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} %define VERSION 3.2.0 -%define RELEASE 2 +%define RELEASE 3 Name: kata-containers Version: %{VERSION} @@ -106,19 +106,25 @@ strip %{buildroot}/usr/bin/containerd-shim-kata-v2 %doc %changelog +* Tue May 7 2024 xuxuepeng - 3.2.0-3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:allow swappiness to be -1 as default + * Tue May 7 2024 wenyuanlau - 3.2.0-2 - Type:feature - ID:NA - SUG:NA - DESC:add stratovirt microvm support for kata 3.2.0 -* Tue Feb 2024 Vanient - 3.2.0-1 +* Tue Feb 19 2024 Vanient - 3.2.0-1 - Type:feature - ID:NA - SUG:NA - DESC:update to 3.2.0 -* Tue Sep 2023 xiadanni - 2.1.0-33 +* Tue Sep 5 2023 xiadanni - 2.1.0-33 - Type:bugfix - ID:NA - SUG:NA diff --git a/patches/0006-Allow-swappiness-to-be-1-as-default.patch b/patches/0006-Allow-swappiness-to-be-1-as-default.patch new file mode 100644 index 0000000..4a19daf --- /dev/null +++ b/patches/0006-Allow-swappiness-to-be-1-as-default.patch @@ -0,0 +1,26 @@ +From 5a85bf2eb90ce9403f3f11e04ae3d5ba35db322a Mon Sep 17 00:00:00 2001 +From: xuxuepeng +Date: Mon, 29 Apr 2024 05:44:44 +0800 +Subject: [PATCH] Allow swappiness to be -1 as default + +Signed-off-by: xuxuepeng +--- + src/agent/rustjail/src/cgroups/fs/mod.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/agent/rustjail/src/cgroups/fs/mod.rs b/src/agent/rustjail/src/cgroups/fs/mod.rs +index 6145f5f..c49d041 100644 +--- a/src/agent/rustjail/src/cgroups/fs/mod.rs ++++ b/src/agent/rustjail/src/cgroups/fs/mod.rs +@@ -475,7 +475,7 @@ fn set_memory_resources(cg: &cgroups::Cgroup, memory: &LinuxMemory, update: bool + if let Some(swappiness) = memory.swappiness { + if (0..=100).contains(&swappiness) { + mem_controller.set_swappiness(swappiness)?; +- } else { ++ } else if swappiness != (-1i64 as u64){ + return Err(anyhow!( + "invalid value:{}. valid memory swappiness range is 0-100", + swappiness +-- +2.33.0 + diff --git a/series.conf b/series.conf index 1cf015c..30f6ba5 100644 --- a/series.conf +++ b/series.conf @@ -3,3 +3,4 @@ 0003-configuration-add-configuration-for-StratoVirt-hyper.patch 0004-kata-deploy-Add-StratoVirt-support-to-deploy-process.patch 0005-mount-Reduce-the-mount-points-with-namespace-isolati.patch +0006-Allow-swappiness-to-be-1-as-default.patch