[Devel] [PATCH RH7] ve/sysinfo: don't clean uptime, procs and loads in containers

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Oct 30 16:47:44 MSK 2017


Have diff-ve-sysinfo-dont-clean-uptime-procs-and-loads-in-containers
in rh6, but in rh7 we moved only si_meminfo(info);\nsi_swapinfo(info);
part, so also move virtinfo_notifier_call part.

Note: bc_fill_sysinfo() does not clear sysinfo for ve0.

rh6 commit message:
Subject: fix sysinfo in containers: don't clean uptime, procs and loads
Date: Fri, 27 Apr 2012 19:37:14 +0400

virtinfo_notifier_call calls bc_fill_sysinfo, which stores for later
calculations totalram and totalswap and then clears entire
sysinfo structure.

Let's fill uptime, procs and loads after call virtinfo_notifier_call.

Fix for http://bugzilla.openvz.org/show_bug.cgi?id=2051

Signed-off-by: Dmitry Guryanov <dguryanov at parallels.com>
Acked-by: Pavel Emelyanov <xemul at parallels.com>

https://jira.sw.ru/browse/PSBM-62094
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 kernel/sys.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index f21cf8ef95f0..aab63ee4a0a5 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2773,6 +2773,11 @@ static int do_sysinfo(struct sysinfo *info)
 	si_meminfo(info);
 	si_swapinfo(info);
 
+#ifdef CONFIG_BEANCOUNTERS
+	if (virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_SYSINFO, info)
+			& NOTIFY_FAIL)
+		return -ENOMSG;
+#endif
 	ve = get_exec_env();
 
 	get_monotonic_boottime(&tp);
@@ -2790,11 +2795,6 @@ static int do_sysinfo(struct sysinfo *info)
 		get_avenrun_ve(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);
 	}
 
-#ifdef CONFIG_BEANCOUNTERS
-	if (virtinfo_notifier_call(VITYPE_GENERAL, VIRTINFO_SYSINFO, info)
-			& NOTIFY_FAIL)
-		return -ENOMSG;
-#endif
 	/*
 	 * If the sum of all the available memory (i.e. ram + swap)
 	 * is less than can be stored in a 32 bit unsigned long then
-- 
2.13.5



More information about the Devel mailing list