[Devel] [PATCH rh7 1/2] mm/tcache: Reset index before repeating invalidation

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Feb 28 18:01:53 MSK 2018


Commit 25176cdcdcc0 ("tcache: Fix race between tcache_invalidate_node()
	and tcache_attach_page()")
removed reseting index before repeating invalidation. Essentially this
broke repeat logic entirely as we retry invalidation past the end of
the file.

Reset index to zero before invalidation retry.

https://jira.sw.ru/browse/PSBM-81760
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/tcache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/tcache.c b/mm/tcache.c
index 6e0c10dd3339..31a9eb3d1e12 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -918,7 +918,7 @@ tcache_invalidate_node_pages(struct tcache_node *node)
 	bool repeat, synchronize_sched_once = true;
 	pgoff_t indices[TCACHE_PAGEVEC_SIZE];
 	struct page *pages[TCACHE_PAGEVEC_SIZE];
-	pgoff_t index = 0;
+	pgoff_t index;
 	unsigned nr_pages;
 	int i;
 
@@ -926,6 +926,7 @@ tcache_invalidate_node_pages(struct tcache_node *node)
 	 * First forbid new page insertions - see tcache_page_tree_replace.
 	 */
 again:
+	index = 0;
 	repeat = false;
 	while ((nr_pages = tcache_lookup(pages, node, index,
 						TCACHE_PAGEVEC_SIZE, indices))) {
-- 
2.16.1



More information about the Devel mailing list