linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zhaoyang Huang <huangzhaoyang@gmail.com>,
	steve.kang@unisoc.com
Subject: Re: [RFC PATCH 1/1] mm: mark folio accessed in minor fault
Date: Wed, 20 Dec 2023 14:14:05 +0000	[thread overview]
Message-ID: <ZYL2rbD5UTz3s8gg@casper.infradead.org> (raw)
In-Reply-To: <20231220102948.1963798-1-zhaoyang.huang@unisoc.com>

On Wed, Dec 20, 2023 at 06:29:48PM +0800, zhaoyang.huang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.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.

This isn't going to be as effective as you imagine.  Almost all file
faults are handled through filemap_map_pages().  So I must ask, what
testing have you done with this patch?

And while you're gathering data, what effect would this patch have on your
workloads?

diff --git a/mm/filemap.c b/mm/filemap.c
index 2e6b1daac6cd..8cecf82dcc5a 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3418,6 +3418,7 @@ static struct folio *next_uptodate_folio(struct xa_state *xas,
 		max_idx = DIV_ROUND_UP(i_size_read(mapping->host), PAGE_SIZE);
 		if (xas->xa_index >= max_idx)
 			goto unlock;
+		folio_mark_accessed(folio);
 		return folio;
 unlock:
 		folio_unlock(folio);



  reply	other threads:[~2023-12-20 14:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20 10:29 zhaoyang.huang
2023-12-20 14:14 ` Matthew Wilcox [this message]
2023-12-21  1:58   ` Zhaoyang Huang
2023-12-21  4:09     ` Matthew Wilcox
2023-12-21  4:53       ` Yu Zhao
2023-12-21  6:28         ` Zhaoyang Huang
2023-12-21  6:32           ` Yu Zhao
2023-12-22  5:53             ` Zhaoyang Huang
2023-12-22  6:14               ` Yu Zhao
2023-12-22  6:28                 ` reply: " 黄朝阳 (Zhaoyang Huang)
2023-12-22  6:45                   ` Yu Zhao
2023-12-22  8:41                     ` Zhaoyang Huang
2023-12-22  9:41                       ` reply: " 黄朝阳 (Zhaoyang Huang)
2023-12-23  2:41                         ` Yu Zhao
2024-01-02  5:36                           ` Zhaoyang Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZYL2rbD5UTz3s8gg@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=steve.kang@unisoc.com \
    --cc=zhaoyang.huang@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox