[RHEL7,COMMIT] memcg, bc/vm_pages.c: drop accidental duplicated counter read

Submitted by Konstantin Khorenko on July 15, 2020, 3:25 p.m.

Details

Message ID 202007151525.06FFPKKN031768@finist-ce7.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko July 15, 2020, 3:25 p.m.
The commit is pushed to "branch-rh7-3.10.0-1127.10.1.vz7.162.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.10.1.vz7.162.9
------>
commit 8197ba04c7359e7bcefc707b1b7e45db6c2acbd5
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Wed Jul 15 18:23:49 2020 +0300

    memcg, bc/vm_pages.c: drop accidental duplicated counter read
    
    Nothing bad happens due to this, just a redundant counter read,
    drop it.
    
    Fixes: 770906b27920d ("memcg, bc/vm_pages.c: account some swapped memory
    as used in CT in /proc/meminfo")
    
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/memcontrol.c | 2 --
 1 file changed, 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c2713cfd99753..13b9e0cd7b5b6 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4673,8 +4673,6 @@  void mem_cgroup_fill_sysinfo(struct mem_cgroup *memcg, struct sysinfo *si)
 	swaped = page_counter_read(&memcg->memsw) - page_counter_read(&memcg->memory);
 	si->totalswap = min(totalswap, memcg->memsw.limit - memcg->memory.limit);
 
-	used = page_counter_read(&memcg->memory);
-
 	if (swaped > si->totalswap) {
 		si->freeswap = 0;
 		used += swaped - si->totalswap;