[RHEL7,COMMIT] mm/tcache: initialize 'repeat' variable only once

Submitted by Konstantin Khorenko on March 1, 2018, 8:54 a.m.

Details

Message ID 201803010854.w218sIdw007947@finist_ce7.work
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko March 1, 2018, 8:54 a.m.
The commit is pushed to "branch-rh7-3.10.0-693.17.1.vz7.45.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.17.1.vz7.45.6
------>
commit e264e98c22b47bec6d3c837e17c8f95683bbcca9
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Thu Mar 1 11:54:18 2018 +0300

    mm/tcache: initialize 'repeat' variable only once
    
    It's pointless to re-initialize the 'repeat' variable before
    invalidation retry since it's used only in the first ivalidate
    attempt (when synchronize_sched_once == true).
    
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 mm/tcache.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/tcache.c b/mm/tcache.c
index 31a9eb3d1e12..02fde409e691 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -915,7 +915,7 @@  static unsigned tcache_lookup(struct page **pages, struct tcache_node *node,
 static noinline_for_stack void
 tcache_invalidate_node_pages(struct tcache_node *node)
 {
-	bool repeat, synchronize_sched_once = true;
+	bool repeat = false, synchronize_sched_once = true;
 	pgoff_t indices[TCACHE_PAGEVEC_SIZE];
 	struct page *pages[TCACHE_PAGEVEC_SIZE];
 	pgoff_t index;
@@ -927,7 +927,6 @@  tcache_invalidate_node_pages(struct tcache_node *node)
 	 */
 again:
 	index = 0;
-	repeat = false;
 	while ((nr_pages = tcache_lookup(pages, node, index,
 						TCACHE_PAGEVEC_SIZE, indices))) {
 		for (i = 0; i < nr_pages; i++) {