[Devel] [PATCH RHEL7 COMMIT] bc/sysinfo: remove dead code

Konstantin Khorenko khorenko at virtuozzo.com
Fri May 22 07:41:12 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.5
------>
commit 33e71af96384f27550118b36f555cac4126bb83d
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Fri May 22 18:41:12 2015 +0400

    bc/sysinfo: remove dead code
    
    If meminfo_val != VE_MEMINFO_DEFAULT in bc_fill_sysinfo, it equals
    VE_MEMINFO_SYSTEM, in which case we return from bc_fill_sysinfo
    immediately.
    
    khorenko@:
    previously (in 2.6.32-x) we had additional VE_MEMINFO_COMPLETE
    (if you check Container's /proc/meminfo fron HN) which showed
    additional debug info: shadow mem, idle mem, etc.
    In vz7 we don't have them => code is not needed.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 kernel/bc/vm_pages.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/kernel/bc/vm_pages.c b/kernel/bc/vm_pages.c
index 7f5eece..b3d0dd0 100644
--- a/kernel/bc/vm_pages.c
+++ b/kernel/bc/vm_pages.c
@@ -202,18 +202,8 @@ static int bc_fill_sysinfo(struct user_beancounter *ub,
 	total = physpages.limit;
 	used = physpages.held;
 
-	if (total == UB_MAXVALUE) {
-		if (meminfo_val == VE_MEMINFO_DEFAULT)
-			total = totalram;
-		else {
-			total = min(meminfo_val, totalram);
-			used = __get_beancounter_usage_percpu(ub, UB_PRIVVMPAGES);
-			if (glob_ve_meminfo) {
-				ub_update_resources(ub);
-				used = ub->ub_parms[UB_OOMGUARPAGES].held;
-			}
-		}
-	}
+	if (total == UB_MAXVALUE)
+		total = totalram;
 
 	si->totalram = total;
 	si->freeram = (total > used ? total - used : 0);
@@ -221,12 +211,8 @@ static int bc_fill_sysinfo(struct user_beancounter *ub,
 	total = swappages.limit;
 	used = swappages.held;
 
-	if (total == UB_MAXVALUE) {
-		if (meminfo_val == VE_MEMINFO_DEFAULT)
-			total = totalswap;
-		else
-			total = 0;
-	}
+	if (total == UB_MAXVALUE)
+		total = totalswap;
 
 	si->totalswap = total;
 	si->freeswap = (total > used ? total - used : 0);



More information about the Devel mailing list