[PATCH v2] tools: fix oom setting of xenstored

Juergen Gross posted 1 patch 2 years, 6 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20211019112140.26988-1-jgross@suse.com
tools/hotplug/Linux/launch-xenstore.in | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH v2] tools: fix oom setting of xenstored
Posted by Juergen Gross 2 years, 6 months ago
Commit f282182af32939 ("tools/xenstore: set oom score for xenstore
daemon on Linux") introduced a regression when not setting the oom
value in the xencommons file. Fix that.

Fixes: f282182af32939 ("tools/xenstore: set oom score for xenstore daemon on Linux")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2: use ${var:-} (Jan Beulich)
---
 tools/hotplug/Linux/launch-xenstore.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/hotplug/Linux/launch-xenstore.in b/tools/hotplug/Linux/launch-xenstore.in
index 8438af9977..e854ca1eb8 100644
--- a/tools/hotplug/Linux/launch-xenstore.in
+++ b/tools/hotplug/Linux/launch-xenstore.in
@@ -60,8 +60,7 @@ test -f @CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons && . @CONFIG_DIR@/@CONFIG_LEAF
 		echo "No xenstored found"
 		exit 1
 	}
-	[ -z "$XENSTORED_OOM_MEM_THRESHOLD" ] || XENSTORED_OOM_MEM_THRESHOLD=50
-	XS_OOM_SCORE=-$(($XENSTORED_OOM_MEM_THRESHOLD * 10))
+	XS_OOM_SCORE=-$((${XENSTORED_OOM_MEM_THRESHOLD:-50} * 10))
 
 	[ "$XENSTORED_MAX_OPEN_FDS" = "unlimited" ] || {
 		[ -z "${XENSTORED_MAX_OPEN_FDS//[0-9]}" ] &&
-- 
2.26.2


Re: [PATCH v2] tools: fix oom setting of xenstored
Posted by Ian Jackson 2 years, 6 months ago
Juergen Gross writes ("[PATCH v2] tools: fix oom setting of xenstored"):
> Commit f282182af32939 ("tools/xenstore: set oom score for xenstore
> daemon on Linux") introduced a regression when not setting the oom
> value in the xencommons file. Fix that.
> 
> Fixes: f282182af32939 ("tools/xenstore: set oom score for xenstore daemon on Linux")
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Ian Jackson <iwj@xenproject.org>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>

and pushed, thanks.

Ian.