[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231220102948.1963798-1-zhaoyang.huang@unisoc.com>
Date: Wed, 20 Dec 2023 18:29:48 +0800
From: "zhaoyang.huang" <zhaoyang.huang@...soc.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Matthew Wilcox
<willy@...radead.org>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>,
Zhaoyang Huang <huangzhaoyang@...il.com>, <steve.kang@...soc.com>
Subject: [RFC PATCH 1/1] mm: mark folio accessed in minor fault
From: Zhaoyang Huang <zhaoyang.huang@...soc.com>
Inactive mapped folio will be promoted to active only when it is
scanned in shrink_inactive_list, while the vfs folio will do this
immidiatly when it is accessed. These will introduce two affections:
1. NR_ACTIVE_FILE is not accurate as expected.
2. Low reclaiming efficiency caused by dummy nactive folio which should
be kept as earlier as shrink_active_list.
I would like to suggest mark the folio be accessed in minor fault to
solve this situation.
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@...soc.com>
---
mm/filemap.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mm/filemap.c b/mm/filemap.c
index f0a15ce1bd1b..b1ee6ce716c2 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3273,6 +3273,11 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
*/
folio = filemap_get_folio(mapping, index);
if (likely(!IS_ERR(folio))) {
+ /*
+ * try to promote inactive folio here when it is accessed
+ * as minor fault
+ */
+ folio_mark_accessed(folio);
/*
* We found the page, so try async readahead before waiting for
* the lock.
--
2.25.1
Powered by blists - more mailing lists