!139 [sync] PR-134: Allow swappiness to be -1 as default

From: @openeuler-sync-bot 
Reviewed-by: @xuxuepeng 
Signed-off-by: @xuxuepeng
This commit is contained in:
openeuler-ci-bot 2024-05-08 06:13:39 +00:00 committed by Gitee
commit d625ea46c6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 36 additions and 3 deletions

View File

@ -2,7 +2,7 @@
%global debug_package %{nil} %global debug_package %{nil}
%define VERSION 3.2.0 %define VERSION 3.2.0
%define RELEASE 2 %define RELEASE 3
Name: kata-containers Name: kata-containers
Version: %{VERSION} Version: %{VERSION}
@ -106,19 +106,25 @@ strip %{buildroot}/usr/bin/containerd-shim-kata-v2
%doc %doc
%changelog %changelog
* Tue May 7 2024 xuxuepeng <xuxuepeng1@huawei.com> - 3.2.0-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:allow swappiness to be -1 as default
* Tue May 7 2024 wenyuanlau <liuwenyuan9@huawei.com> - 3.2.0-2 * Tue May 7 2024 wenyuanlau <liuwenyuan9@huawei.com> - 3.2.0-2
- Type:feature - Type:feature
- ID:NA - ID:NA
- SUG:NA - SUG:NA
- DESC:add stratovirt microvm support for kata 3.2.0 - DESC:add stratovirt microvm support for kata 3.2.0
* Tue Feb 2024 Vanient <xidanni1@huawei.com> - 3.2.0-1 * Tue Feb 19 2024 Vanient <xidanni1@huawei.com> - 3.2.0-1
- Type:feature - Type:feature
- ID:NA - ID:NA
- SUG:NA - SUG:NA
- DESC:update to 3.2.0 - DESC:update to 3.2.0
* Tue Sep 2023 xiadanni <xiadanni1@huawei.com> - 2.1.0-33 * Tue Sep 5 2023 xiadanni <xiadanni1@huawei.com> - 2.1.0-33
- Type:bugfix - Type:bugfix
- ID:NA - ID:NA
- SUG:NA - SUG:NA

View File

@ -0,0 +1,26 @@
From 5a85bf2eb90ce9403f3f11e04ae3d5ba35db322a Mon Sep 17 00:00:00 2001
From: xuxuepeng <xuxuepeng1@huawei.com>
Date: Mon, 29 Apr 2024 05:44:44 +0800
Subject: [PATCH] Allow swappiness to be -1 as default
Signed-off-by: xuxuepeng <xuxuepeng1@huawei.com>
---
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

View File

@ -3,3 +3,4 @@
0003-configuration-add-configuration-for-StratoVirt-hyper.patch 0003-configuration-add-configuration-for-StratoVirt-hyper.patch
0004-kata-deploy-Add-StratoVirt-support-to-deploy-process.patch 0004-kata-deploy-Add-StratoVirt-support-to-deploy-process.patch
0005-mount-Reduce-the-mount-points-with-namespace-isolati.patch 0005-mount-Reduce-the-mount-points-with-namespace-isolati.patch
0006-Allow-swappiness-to-be-1-as-default.patch