public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/rmap: vm_flags including VM_EXEC can exit timely
@ 2023-10-24 14:49 Zhiguo Jiang
  2023-10-24 15:51 ` David Hildenbrand
  0 siblings, 1 reply; 6+ messages in thread
From: Zhiguo Jiang @ 2023-10-24 14:49 UTC (permalink / raw)
  To: Andrew Morton, linux-mm, linux-kernel; +Cc: opensource.kernel, Zhiguo Jiang

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@vivo.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-10-26  2:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 14:49 [PATCH] mm/rmap: vm_flags including VM_EXEC can exit timely Zhiguo Jiang
2023-10-24 15:51 ` David Hildenbrand
2023-10-25  1:17   ` zhiguojiang
2023-10-25  3:04     ` zhiguojiang
2023-10-25 15:04       ` David Hildenbrand
2023-10-26  2:04         ` zhiguojiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox