[Devel,RHEL7,COMMIT] tcache: Remove excess variable from tcache_lru_isolate()

Submitted by Konstantin Khorenko on Aug. 31, 2017, 3:18 p.m.

Details

Message ID 201708311518.v7VFIJUH017411@finist_ce7.work
State New
Series "tcache: Manage LRU lists under per-filesystem lock"
Headers show

Commit Message

Konstantin Khorenko Aug. 31, 2017, 3:18 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.35.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.35.5
------>
commit e6c8082f25609c977202364e85e72f6c2442d4b5
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Thu Aug 31 18:18:19 2017 +0300

    tcache: Remove excess variable from tcache_lru_isolate()
    
    We have two variables (nr and nr_isolated), which show the same.
    Kill one of them.
    
    v2: new
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
    Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/tcache.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/tcache.c b/mm/tcache.c
index 0e57ae6..0f15e8e 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -1029,7 +1029,7 @@  tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
 {
 	struct tcache_nodeinfo *ni = &tcache_nodeinfo[nid];
 	struct tcache_pool_nodeinfo *pni;
-	int nr, nr_isolated = 0;
+	int nr_isolated = 0;
 	struct rb_node *rbn;
 
 	spin_lock_irq(&ni->lock);
@@ -1046,9 +1046,8 @@  tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
 		goto again;
 
 	spin_lock(&pni->lock);
-	nr = __tcache_lru_isolate(pni, pages, nr_to_isolate);
-	ni->nr_pages -= nr;
-	nr_isolated += nr;
+	nr_isolated = __tcache_lru_isolate(pni, pages, nr_to_isolate);
+	ni->nr_pages -= nr_isolated;
 
 	if (!list_empty(&pni->lru))
 		__tcache_insert_reclaim_node(ni, pni);