From: Xin Hao <xhao@linux.alibaba.com>
To: sj@kernel.org
Cc: akpm@linux-foundation.org, damon@lists.linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
xhao@linux.alibaba.com
Subject: [PATCH] mm/damon: add MADV_COLLAPSE support in damos_action
Date: Tue, 13 Sep 2022 19:47:35 +0800 [thread overview]
Message-ID: <20220913114735.22841-1-xhao@linux.alibaba.com> (raw)
MADV_COLLAPSE has large different with MDVA_HUGE in dealing with huge
pages, it doesn't need to rely on 'khugepage' thread to create THP.
So combining with it will give damon users more options.
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
include/linux/damon.h | 1 +
mm/damon/vaddr.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/linux/damon.h b/include/linux/damon.h
index 016b6c9c03d6..c44f9410d997 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -97,6 +97,7 @@ enum damos_action {
DAMOS_PAGEOUT,
DAMOS_HUGEPAGE,
DAMOS_NOHUGEPAGE,
+ DAMOS_COLLAPSE,
DAMOS_LRU_PRIO,
DAMOS_LRU_DEPRIO,
DAMOS_STAT, /* Do nothing but only record the stat */
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index c2c08c1b316b..58c0d068563d 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -655,6 +655,9 @@ static unsigned long damon_va_apply_scheme(struct damon_ctx *ctx,
case DAMOS_NOHUGEPAGE:
madv_action = MADV_NOHUGEPAGE;
break;
+ case DAMOS_COLLAPSE:
+ madv_action = MADV_COLLAPSE;
+ break;
case DAMOS_STAT:
return 0;
default:
--
2.31.0
next reply other threads:[~2022-09-13 11:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 11:47 Xin Hao [this message]
2022-09-13 15:17 ` SeongJae Park
2022-09-13 15:29 ` haoxin
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=20220913114735.22841-1-xhao@linux.alibaba.com \
--to=xhao@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.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