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

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 1 11:54:18 MSK 2018


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 at 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 at virtuozzo.com>
    Acked-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 mm/tcache.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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++) {


More information about the Devel mailing list