[Devel] [PATCH rh7 3/5] bc: sysinfo: remove dead code

Vladimir Davydov vdavydov at parallels.com
Mon May 18 07:24:58 PDT 2015


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.

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 7f5eece57aa7..b3d0dd09f8cf 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);
-- 
1.7.10.4




More information about the Devel mailing list