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

Submitted by Andrey Ryabinin on Oct. 18, 2018, 9:02 a.m.

Details

Message ID 20181018090231.7924-1-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin Oct. 18, 2018, 9:02 a.m.
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@virtuozzo.com>
---
 mm/tcache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);
 	}