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

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 30 19:24:48 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.vz7.37.20
------>
commit 2429a0ee4130b635d73fa5afaff3b899a765d903
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Mon Oct 30 19:24:48 2017 +0300

    ve/sysinfo: don't clean uptime, procs and loads in containers
    
    Have diff-ve-sysinfo-dont-clean-uptime-procs-and-loads-in-containers
    in rh6, but in rh7 we moved only
       si_meminfo(info);
       si_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 f21cf8e..aab63ee4 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


More information about the Devel mailing list