[Devel] [PATCH rh7 1/3] mm/tcache: don't insert empty reclaim node

Andrey Ryabinin aryabinin at virtuozzo.com
Thu Oct 18 12:02:29 MSK 2018


If tcache_lru_del() deletes last page from node we don't need to
insert reclaim node into tree.

https://jira.sw.ru/browse/PSBM-89403
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 9fc7cbf1c40b..960450bb825e 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -319,7 +319,8 @@ static void tcache_lru_del(struct tcache_pool *pool, struct page *page,
 		spin_lock(&ni->lock);
 		if (!RB_EMPTY_NODE(&pni->reclaim_node))
 			rb_erase(&pni->reclaim_node, &ni->reclaim_tree);
-		__tcache_insert_reclaim_node(ni, pni);
+		if (!list_empty(&pni->lru))
+			__tcache_insert_reclaim_node(ni, pni);
 		update_ni_rb_first(ni);
 		spin_unlock(&ni->lock);
 	}
-- 
2.18.1



More information about the Devel mailing list