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

Submitted by Konstantin Khorenko on Oct. 30, 2017, 4:24 p.m.

Details

Message ID 201710301624.v9UGOmer016233@finist_ce7.work
State New
Series "ve/sysinfo: don't clean uptime, procs and loads in containers"
Headers show

Commit Message

Konstantin Khorenko Oct. 30, 2017, 4:24 p.m.
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@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@parallels.com>
    
    Acked-by: Pavel Emelyanov <xemul@parallels.com>
    
    https://jira.sw.ru/browse/PSBM-62094
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 kernel/sys.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

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

Comments

Konstantin Khorenko Oct. 30, 2017, 4:26 p.m.
Please consider releasing a ReadyKernel patch for it.

https://readykernel.com/

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 10/30/2017 07:24 PM, Konstantin Khorenko wrote:
> 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@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@parallels.com>
>
>     Acked-by: Pavel Emelyanov <xemul@parallels.com>
>
>     https://jira.sw.ru/browse/PSBM-62094
>     Signed-off-by: Pavel Tikhomirov <ptikhomirov@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
> .
>