[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231024144913.421-1-justinjiang@vivo.com>
Date: Tue, 24 Oct 2023 22:49:12 +0800
From: Zhiguo Jiang <justinjiang@...o.com>
To: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com, Zhiguo Jiang <justinjiang@...o.com>
Subject: [PATCH] mm/rmap: vm_flags including VM_EXEC can exit timely
When pra->vm_flags include VM_EXEC flag and folio is file detected in
folio_referenced_one(), the folio referenced traversal process can be
exited timely to reduce the detecting folio referenced time.
Signed-off-by: Zhiguo Jiang <justinjiang@...o.com>
---
mm/rmap.c | 2 ++
1 file changed, 2 insertions(+)
mode change 100644 => 100755 mm/rmap.c
diff --git a/mm/rmap.c b/mm/rmap.c
index 7a27a2b41802..932f3b7e8521
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -884,6 +884,8 @@ static bool folio_referenced_one(struct folio *folio,
if (referenced) {
pra->referenced++;
pra->vm_flags |= vma->vm_flags & ~VM_LOCKED;
+ if ((pra->vm_flags | VM_EXEC) && folio_is_file_lru(folio))
+ return false;
}
if (!pra->mapcount)
--
2.39.0
Powered by blists - more mailing lists