linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Minwoo Jo <chminoo@g.cbnu.ac.kr>
Cc: SeongJae Park <sj@kernel.org>,
	akpm@linux-foundation.org, rostedt@goodmis.org,
	mhiramat@kernel.org, willy@infradead.org, linux-mm@kvack.org
Subject: Re: [PATCH] Hitshield : Something new eviction process for MGLRU
Date: Tue,  8 Oct 2024 11:50:13 -0700	[thread overview]
Message-ID: <20241008185013.64990-1-sj@kernel.org> (raw)
In-Reply-To: <20240802000546.322036-1-chminoo@g.cbnu.ac.kr>

Hello Minwoo,

On Fri, 2 Aug 2024 00:05:46 +0000 Minwoo Jo <chminoo@g.cbnu.ac.kr> wrote:

> Signed-off-by: Minwoo Jo <chminoo@g.cbnu.ac.kr>
> 
> This commit addresses the page space occupancy issue that arose
> in the previous commit with the HitShield technology.
> 
> The HitShield technology is based on the observation that MGLRU
> does not take into account the state of the folio during eviction.
> 
> I assumed that if a folio, which has been updated only 1 to 3 times,
> has increased in generation until the point of eviction,
> it is likely to be referenced less in the future.

So, my humble understanding of the point is that, you want to improve the
kernel's reclamation logic by making it awares not only recency, but also
frequency?

Given existence of several previous frequency based page placement algorithm
optimization researches including LRFU, CAR and CART, I think the overall idea
might make sense at least in some use cases.  I'm not sure whether the
threshold value and the mechanism to measure the frequency make sense and/or
can be applied to general cases, though.

> 
> Therefore, I implemented this technology to protect frequently updated folios.
> 
> I added the hitshield_0, hitshield_1, and hitshield flags to the page flag.
> 
> Upon my review, I confirmed that the flags occupy positions 0 to 28.
> 
> Thus, I believe that allocating 3 flags, or 3 bits, is sufficient.

As others also mentioned, I think even three bits could be challinging to add.

In my humble opinion, frequency monitoring could be done using data structures
and access check mechanisms other than folio/LRU and reclamation logic.  Then,
the monitoring mechanism could manipulate LRU lists based on the frequency
data.  Modifying reclamation code to refer to the frequency data could also be
another way.

DAMON_LRU_SORT [1,2] could be an example of such approaches (driven by the
monitoring mechanism without reclamation code modification).  Of course,
DAMON_LRU_SORT would have many limitations and rooms for improvements.  I'm
curious if you also had a time to consider that kind of approaches?  If you did
so but found some critical problems and resulted in this patch, it would be
great if you can further share the found problems.

[1] https://lwn.net/Articles/905370/
[2] https://www.kernel.org/doc/html/latest/admin-guide/mm/damon/lru_sort.html


Thanks,
SJ

[...]


  parent reply	other threads:[~2024-10-08 18:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02  0:05 Minwoo Jo
2024-08-05 11:29 ` Vlastimil Babka
2024-08-05 11:56 ` David Hildenbrand
2024-10-08 18:50 ` SeongJae Park [this message]
2024-10-28  7:32   ` Minwoo Jo
     [not found] <20241008084411.196455-1-chminoo@g.cbnu.ac.kr>
     [not found] ` <b78d1aa5-1de4-4050-80a5-cbd4bc1eb8f2@efficios.com>
     [not found]   ` <c84e6cb4-646c-4b70-9834-3d0f66f51787@efficios.com>
2024-10-08 16:04     ` Minwoo Jo
  -- strict thread matches above, loose matches on Subject: below --
2024-07-20 14:25 [PATCH] HitShield:Something " Minwoo Jo
2024-07-20 15:34 ` Matthew Wilcox

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=20241008185013.64990-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chminoo@g.cbnu.ac.kr \
    --cc=linux-mm@kvack.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=willy@infradead.org \
    /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