Thread (101 messages) 101 messages, 10 authors, 2020-09-23
STALE2130d
Revisions (4)
  1. v1 [diff vs current]
  2. v16 [diff vs current]
  3. v18 current
  4. v19 [diff vs current]

[PATCH v18 07/32] mm/swap.c: stop deactivate_file_page if page not on lru

From: Alex Shi <hidden>
Date: 2020-08-24 12:58:55
Also in: linux-mm, lkml
Subsystem: memory management, memory management - mglru (multi-gen lru), memory management - swap, the rest · Maintainers: Andrew Morton, Chris Li, Kairui Song, Linus Torvalds

Keeping deactivate_file_page is useless if page isn't on lru list. So
let's stop it.

Signed-off-by: Alex Shi <alex.shi-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org>
Cc: Hugh Dickins <redacted>
Cc: Johannes Weiner <redacted>
Cc: Michal Hocko <redacted>
Cc: Vladimir Davydov <redacted>
Cc: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
---
 mm/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swap.c b/mm/swap.c
index c674fb441fe9..ea9e1f538313 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -671,7 +671,7 @@ void deactivate_file_page(struct page *page)
 	 * In a workload with many unevictable page such as mprotect,
 	 * unevictable page deactivation for accelerating reclaim is pointless.
 	 */
-	if (PageUnevictable(page))
+	if (PageUnevictable(page) || !PageLRU(page))
 		return;
 
 	if (likely(get_page_unless_zero(page))) {
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help