Skip to contentSkip to conversation

mm/damon: update expired description of damos_action

PATCH Superseded Sang-Heon Jeon 3 participants 18 messages Jul 31, 2025 – Aug 5, 2025

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/damon: update expired description of damos_action

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

---
I also found below patch(https://lore.kernel.org/damon/[email protected]/T/#t) So, Is it means that DAMOS_STAT is only supported by paddr now?
If my understanding is correct, then we need to fix Design documentation
and comments both.

However, since it will be fixed soon. Keeping current status is also affordable. So could you check this point as well?

---

 include/linux/damon.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/damon.h +3 -3
index cddf82eaac4e..0870e9f48b0f 100644
@@ -128,7 +128,7 @@ struct damon_access_report {
  *
  * @DAMOS_WILLNEED:	Call ``madvise()`` for the region with MADV_WILLNEED.
  * @DAMOS_COLD:		Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT:	Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT:	Reclaim the region.
  * @DAMOS_HUGEPAGE:	Call ``madvise()`` for the region with MADV_HUGEPAGE.
  * @DAMOS_NOHUGEPAGE:	Call ``madvise()`` for the region with MADV_NOHUGEPAGE.
  * @DAMOS_LRU_PRIO:	Prioritize the region on its LRU lists.
@@ -146,8 +146,8 @@ struct damon_access_report {
  * The support of each action is up to running &struct damon_operations.
  * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
  * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * supports all actions except &enum DAMOS_WILLNEED, &enum DAMOS_COLD,
+ * &enum DAMOS_HUGEPAGE, &enum DAMOS_NOHUGEPAGE.
  */
 enum damos_action {
 	DAMOS_WILLNEED,
Signature · 1 line
2.43.0
maintainer
#1 lore raw

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

Thank you for catching this and fixing!

Quoted 5 lines

---
I also found below patch(https://lore.kernel.org/damon/[email protected]/T/#t) So, Is it means that DAMOS_STAT is only supported by paddr now?

No. 'vaddr' supports DAMOS_STAT. The patch is not adding DAMOS_STAT support on vaddr, but extending the support for DAMOS filters.

Thank you for checking the thread and asking this question, though. I see this as an important signal of another rooms to improve on the documentation.

include/linux/damon.h struct damon_access_report {

Quoted 16 lines

If my understanding is correct, then we need to fix Design documentation and comments both.

However, since it will be fixed soon. Keeping current status is also affordable. So could you check this point as well?

---

 include/linux/damon.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/damon.h +0 -0
index cddf82eaac4e..0870e9f48b0f 100644
@@ -128,7 +128,7 @@ struct damon_access_report {

Seems you are using damon/next as your baseline. If there is no real dependencies to damon/next, please use mm-new as your baseline. For more contexts about that, please refer to the DAMON maintainer-profile[1].

include/linux/damon.h struct damon_access_report { · line 131

Quoted 5 lines
include/linux/damon.h +1 -1
  *
  * @DAMOS_WILLNEED:	Call ``madvise()`` for the region with MADV_WILLNEED.
  * @DAMOS_COLD:		Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT:	Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT:	Reclaim the region.

Nice!

include/linux/damon.h struct damon_access_report { · line 150

Quoted 11 lines
include/linux/damon.h +2 -2
  * @DAMOS_HUGEPAGE:	Call ``madvise()`` for the region with MADV_HUGEPAGE.
  * @DAMOS_NOHUGEPAGE:	Call ``madvise()`` for the region with MADV_NOHUGEPAGE.
  * @DAMOS_LRU_PRIO:	Prioritize the region on its LRU lists.
@@ -146,8 +146,8 @@ struct damon_access_report {
  * The support of each action is up to running &struct damon_operations.
  * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
  * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * supports all actions except &enum DAMOS_WILLNEED, &enum DAMOS_COLD,
+ * &enum DAMOS_HUGEPAGE, &enum DAMOS_NOHUGEPAGE.

Thank you for updating this!

But, now I find this place is having outdated information that partially duplicated with the DAMON design document[2]. I think the design document is better to maintain this kind of details. What about keeping the high level information but giving a reference to the documentation for details, for example, like below?

@@ -143,11 +143,9 @@ struct damon_access_report {
* @DAMOS_STAT: Do nothing but count the stat.
* @NR_DAMOS_ACTIONS: Total number of DAMOS actions
*
- * The support of each action is up to running &struct damon_operations.
- * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
- * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO. &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * The support of each action is up to running &struct damon_operations. Refer
+ * to 'Operation Action' section of Documentation/mm/damon/design.rst for
+ * status of the supports.
*/

Thanks,
SJ

[1] https://origin.kernel.org/doc/html/next/mm/damon/maintainer-profile.html#scm-trees
[2] https://origin.kernel.org/doc/html/next/mm/damon/design.html#operation-action

#2 lore raw

Hi Sang-Heon and SeongJae,

Quoted 43 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

Thank you for catching this and fixing!

Quoted 5 lines

---
I also found below patch(https://lore.kernel.org/damon/[email protected]/T/#t) So, Is it means that DAMOS_STAT is only supported by paddr now?

No. 'vaddr' supports DAMOS_STAT. The patch is not adding DAMOS_STAT support on vaddr, but extending the support for DAMOS filters.

Thank you for checking the thread and asking this question, though. I see this as an important signal of another rooms to improve on the documentation.

include/linux/damon.h struct damon_access_report {

Quoted 16 lines

If my understanding is correct, then we need to fix Design documentation and comments both.

However, since it will be fixed soon. Keeping current status is also affordable. So could you check this point as well?

---

  include/linux/damon.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/damon.h +0 -0
index cddf82eaac4e..0870e9f48b0f 100644
@@ -128,7 +128,7 @@ struct damon_access_report {

Seems you are using damon/next as your baseline. If there is no real dependencies to damon/next, please use mm-new as your baseline. For more contexts about that, please refer to the DAMON maintainer-profile[1].

Quoted 7 lines

include/linux/damon.h struct damon_access_report { · line 131

Quoted 5 lines
include/linux/damon.h +1 -1
   *
   * @DAMOS_WILLNEED:  Call ``madvise()`` for the region with MADV_WILLNEED.
   * @DAMOS_COLD:              Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT:   Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT:   Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Thanks,
Honggyu

Quoted 40 lines

include/linux/damon.h struct damon_access_report { · line 150

Quoted 11 lines
include/linux/damon.h +2 -2
   * @DAMOS_HUGEPAGE:  Call ``madvise()`` for the region with MADV_HUGEPAGE.
   * @DAMOS_NOHUGEPAGE:        Call ``madvise()`` for the region with MADV_NOHUGEPAGE.
   * @DAMOS_LRU_PRIO:  Prioritize the region on its LRU lists.
@@ -146,8 +146,8 @@ struct damon_access_report {
   * The support of each action is up to running &struct damon_operations.
   * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
   * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * supports all actions except &enum DAMOS_WILLNEED, &enum DAMOS_COLD,
+ * &enum DAMOS_HUGEPAGE, &enum DAMOS_NOHUGEPAGE.

Thank you for updating this!

But, now I find this place is having outdated information that partially duplicated with the DAMON design document[2]. I think the design document is better to maintain this kind of details. What about keeping the high level information but giving a reference to the documentation for details, for example, like below?

@@ -143,11 +143,9 @@ struct damon_access_report {
* @DAMOS_STAT: Do nothing but count the stat.
* @NR_DAMOS_ACTIONS: Total number of DAMOS actions
*
- * The support of each action is up to running &struct damon_operations.
- * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
- * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO. &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * The support of each action is up to running &struct damon_operations. Refer
+ * to 'Operation Action' section of Documentation/mm/damon/design.rst for
+ * status of the supports.
*/

Thanks,
SJ

[1] https://origin.kernel.org/doc/html/next/mm/damon/maintainer-profile.html#scm-trees
[2] https://origin.kernel.org/doc/html/next/mm/damon/design.html#operation-action

#3 lore raw

Hi, Honggyu

Quoted 53 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 49 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

Thank you for catching this and fixing!

Quoted 5 lines

---
I also found below patch(https://lore.kernel.org/damon/[email protected]/T/#t) So, Is it means that DAMOS_STAT is only supported by paddr now?

No. 'vaddr' supports DAMOS_STAT. The patch is not adding DAMOS_STAT support on vaddr, but extending the support for DAMOS filters.

Thank you for checking the thread and asking this question, though. I see this as an important signal of another rooms to improve on the documentation.

include/linux/damon.h struct damon_access_report {

Quoted 16 lines

If my understanding is correct, then we need to fix Design documentation and comments both.

However, since it will be fixed soon. Keeping current status is also affordable. So could you check this point as well?

---

  include/linux/damon.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/damon.h +0 -0
index cddf82eaac4e..0870e9f48b0f 100644
@@ -128,7 +128,7 @@ struct damon_access_report {

Seems you are using damon/next as your baseline. If there is no real dependencies to damon/next, please use mm-new as your baseline. For more contexts about that, please refer to the DAMON maintainer-profile[1].

Quoted 5 lines
include/linux/damon.h +1 -1
   *
   * @DAMOS_WILLNEED:  Call ``madvise()`` for the region with MADV_WILLNEED.
   * @DAMOS_COLD:              Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT:   Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT:   Reclaim the region.
Quoted 6 lines
Quoted 1 line

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

My intention was just to synchronize with the Design documentation.

So how about changing the description to Page out the region, Would this be also confusing?
I feel like it would be clearer than using word "reclaim"

Quoted 44 lines

Thanks,
Honggyu

Quoted 40 lines

include/linux/damon.h struct damon_access_report { · line 150

Quoted 11 lines
include/linux/damon.h +2 -2
   * @DAMOS_HUGEPAGE:  Call ``madvise()`` for the region with MADV_HUGEPAGE.
   * @DAMOS_NOHUGEPAGE:        Call ``madvise()`` for the region with MADV_NOHUGEPAGE.
   * @DAMOS_LRU_PRIO:  Prioritize the region on its LRU lists.
@@ -146,8 +146,8 @@ struct damon_access_report {
   * The support of each action is up to running &struct damon_operations.
   * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
   * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * supports all actions except &enum DAMOS_WILLNEED, &enum DAMOS_COLD,
+ * &enum DAMOS_HUGEPAGE, &enum DAMOS_NOHUGEPAGE.

Thank you for updating this!

But, now I find this place is having outdated information that partially duplicated with the DAMON design document[2]. I think the design document is better to maintain this kind of details. What about keeping the high level information but giving a reference to the documentation for details, for example, like below?

@@ -143,11 +143,9 @@ struct damon_access_report {
* @DAMOS_STAT: Do nothing but count the stat.
* @NR_DAMOS_ACTIONS: Total number of DAMOS actions
*
- * The support of each action is up to running &struct damon_operations.
- * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
- * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO. &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * The support of each action is up to running &struct damon_operations. Refer
+ * to 'Operation Action' section of Documentation/mm/damon/design.rst for
+ * status of the supports.
*/

Thanks,
SJ

[1] https://origin.kernel.org/doc/html/next/mm/damon/maintainer-profile.html#scm-trees
[2] https://origin.kernel.org/doc/html/next/mm/damon/design.html#operation-action

Best Regards.
Sang-Heon Jeon

maintainer
#4 lore raw
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Quoted 6 lines

My intention was just to synchronize with the Design documentation.

So how about changing the description to Page out the region, Would this be also confusing?
I feel like it would be clearer than using word "reclaim"

In my opinion, "reclaim" is good.

Thanks,
SJ

[...]

#5 lore raw

Hi SeongJae and Sang-Heon,

Quoted 26 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

The replated commit is as follows.
mm/migrate: add sysfs interface to enable reclaim migration
https://github.com/torvalds/linux/commit/20b51af15e014cac63b58a4f8b8b323ac35bccce

Quoted 7 lines
Quoted 7 lines

My intention was just to synchronize with the Design documentation.

So how about changing the description to Page out the region, Would this be also confusing?
I feel like it would be clearer than using word "reclaim"

I don't have a good idea but it looks like recusive explanation.

Quoted 2 lines

In my opinion, "reclaim" is good.

I wish there could be better term that distinguishes between swap out and demotion. In my understanding "reclaim" includes both swap out and demotion.

I also found that man page explanation about MADV_PAGEOUT is "reclaim these pages". If this is correct, then maybe demotion isn't included in "reclaim".

Thanks,
Honggyu

maintainer
#6 lore raw
Quoted 34 lines · On Sun, 3 Aug 2025 11:03:12 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae and Sang-Heon,

Quoted 31 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Quoted 4 lines
Quoted 2 lines

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

I'm unsure to what point you are saying "no". Are you saying DAMOS_PAGEOUT can also do demotion when demotion_enabled is set? Or not? Could you please clarify, and add more explanations about why you think so?

Quoted 9 lines

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

I'm again get confused. Isn't it opposite?

```
static bool can_demote(int nid, struct scan_control *sc,
		       struct mem_cgroup *memcg)
{
	int demotion_nid;

	if (!numa_demotion_enabled)
		return false;
```

It returns "false" when demotion_enabled is "off" (unset). Am I reading something wrong...?

Quoted 13 lines

The replated commit is as follows.
mm/migrate: add sysfs interface to enable reclaim migration
https://github.com/torvalds/linux/commit/20b51af15e014cac63b58a4f8b8b323ac35bccce

Quoted 7 lines
Quoted 7 lines

My intention was just to synchronize with the Design documentation.

So how about changing the description to Page out the region, Would this be also confusing?
I feel like it would be clearer than using word "reclaim"

Quoted 7 lines

I don't have a good idea but it looks like recusive explanation.

Quoted 2 lines

In my opinion, "reclaim" is good.

I wish there could be better term that distinguishes between swap out and demotion. In my understanding "reclaim" includes both swap out and demotion.

"Reclaim" also includes writeback operations.

I agree we have many rooms to improve in terms of terminologies. But, I'd argue we don't need to have only 1:1 mapping terminologies. Othrwise, maybe we don't need any documentation at all but just code. "Reclaim" is a good general terminology for describing an effort to get free pages on a memory domain (NUMA node, zone, etc), in my opinion.

To be honest, btw, I'm not a fan of "promote/demote", and that was one of the reasons I insisted "DAMOS_MIGRATE_{HOT,COLD}" instead of "DAMOS_{PROMOTE,DEMOTE}".

Quoted 3 lines

I also found that man page explanation about MADV_PAGEOUT is "reclaim these pages". If this is correct, then maybe demotion isn't included in "reclaim".

I interpret the term "reclaim" on the man page with a flexibility including my above definition, and hence I don't think this is contradicting in a very bad way against what I'm understanding. That is, I interpret the documentation says MADV_PAGEOUT can also do demote pages under certain conditions.

I didn't write the documentation, so I may be completely wrong. I also frustratingly lost my resource to validate the main question of this discussion (whether DAMOS_PAGEOUT can also do demotion or not), for now. I'd like to continue this discussion based on code rather than a documentation that _might_ be right or wrong, and preferrably based on real tests if you or I have a good testing setup.

Thanks,
SJ

[...]

#7 lore raw

Hi SeongJae,

Quoted 36 lines · SeongJae Park
Quoted 34 lines · On Sun, 3 Aug 2025 11:03:12 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae and Sang-Heon,

Quoted 31 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

I'm unsure to what point you are saying "no". Are you saying DAMOS_PAGEOUT can also do demotion when demotion_enabled is set? Or not? Could you please clarify, and add more explanations about why you think so?

I checked it again and found I pointed out in the wrong place. Please see below.

Quoted 5 lines
Quoted 5 lines

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

Quoted 7 lines
Quoted 5 lines

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

I'm again get confused. Isn't it opposite?

The thing is that DAMOS_PAGEOUT call sequence is as follows.

DAMOS_PAGEOUT
-> damon_pa_pageout
-> reclaim_pages
-> reclaim_folio_list

In reclaim_folio_list(), it sets "no_demotion = 1" in scan_control, then invokes shrink_folio_list().
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L2237

Inside shrink_folio_list(), it calls can_demote() and it returns false even if demotion_enabled is true.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L352-L353

Quoted 11 lines
```
static bool can_demote(int nid, struct scan_control *sc,
                        struct mem_cgroup *memcg)
{
         int demotion_nid;

         if (!numa_demotion_enabled)
                 return false;
```
Quoted 2 lines

It returns "false" when demotion_enabled is "off" (unset). Am I reading something wrong...?

The full implementation of can_demote is as follows. It checks whether "no_demotion" is set.

static bool can_demote(int nid, struct scan_control *sc,
struct mem_cgroup *memcg)

{
	int demotion_nid;

	if (!numa_demotion_enabled)
		return false;
	if (sc && sc->no_demotion)
		return false;

	demotion_nid = next_demotion_node(nid);
	if (demotion_nid == NUMA_NO_NODE)
		return false;

	/* If demotion node isn't in the cgroup's mems_allowed, fall back */
	return mem_cgroup_node_allowed(memcg, demotion_nid);
}

Hope this is helpful.

Quoted 30 lines
Quoted 14 lines

The replated commit is as follows.
mm/migrate: add sysfs interface to enable reclaim migration
https://github.com/torvalds/linux/commit/20b51af15e014cac63b58a4f8b8b323ac35bccce

Quoted 7 lines
Quoted 7 lines

My intention was just to synchronize with the Design documentation.

So how about changing the description to Page out the region, Would this be also confusing?
I feel like it would be clearer than using word "reclaim"

Quoted 7 lines

I don't have a good idea but it looks like recusive explanation.

Quoted 2 lines

In my opinion, "reclaim" is good.

I wish there could be better term that distinguishes between swap out and demotion. In my understanding "reclaim" includes both swap out and demotion.

"Reclaim" also includes writeback operations.

I agree we have many rooms to improve in terms of terminologies. But, I'd argue we don't need to have only 1:1 mapping terminologies. Othrwise, maybe we don't need any documentation at all but just code. "Reclaim" is a good general terminology for describing an effort to get free pages on a memory domain (NUMA node, zone, etc), in my opinion.

Quoted 3 lines

To be honest, btw, I'm not a fan of "promote/demote", and that was one of the reasons I insisted "DAMOS_MIGRATE_{HOT,COLD}" instead of "DAMOS_{PROMOTE,DEMOTE}".

I do agree, I feel the current memory tiering system doesn't represent the tiered memory topology so promote/demote might not be good terms for now.

Quoted 10 lines
Quoted 4 lines

I also found that man page explanation about MADV_PAGEOUT is "reclaim these pages". If this is correct, then maybe demotion isn't included in "reclaim".

I interpret the term "reclaim" on the man page with a flexibility including my above definition, and hence I don't think this is contradicting in a very bad way against what I'm understanding. That is, I interpret the documentation says MADV_PAGEOUT can also do demote pages under certain conditions.

Quoted 6 lines

I didn't write the documentation, so I may be completely wrong. I also frustratingly lost my resource to validate the main question of this discussion (whether DAMOS_PAGEOUT can also do demotion or not), for now. I'd like to continue this discussion based on code rather than a documentation that _might_ be right or wrong, and preferrably based on real tests if you or I have a good testing setup.

The code I showed above explains well enough about this.

Thanks,
Honggyu

maintainer
#8 lore raw
Quoted 65 lines · On Sun, 3 Aug 2025 13:43:03 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae,

Quoted 36 lines · SeongJae Park
Quoted 34 lines · On Sun, 3 Aug 2025 11:03:12 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae and Sang-Heon,

Quoted 31 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

I'm unsure to what point you are saying "no". Are you saying DAMOS_PAGEOUT can also do demotion when demotion_enabled is set? Or not? Could you please clarify, and add more explanations about why you think so?

I checked it again and found I pointed out in the wrong place. Please see below.

Quoted 5 lines
Quoted 5 lines

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

Quoted 7 lines
Quoted 5 lines

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

I'm again get confused. Isn't it opposite?

The thing is that DAMOS_PAGEOUT call sequence is as follows.

Quoted 7 lines
   DAMOS_PAGEOUT
   -> damon_pa_pageout
   -> reclaim_pages
   -> reclaim_folio_list

In reclaim_folio_list(), it sets "no_demotion = 1" in scan_control, then invokes shrink_folio_list().

Thank you, this clarifies. DAMOS_PAGEOUT doesn't demote pages even if demotion_enabled is set. Thank you for enlightening me.

So, "reclaim" means "reclaim". shrink_folio_list() can do demotions when demotion_enabled is set. I hence still don't think this patch is saying something very wrong, and how it could be improved. Do you have more specific change suggestions for this patch for an improvment?

Thanks,
SJ

#9 lore raw
Quoted 72 lines · SeongJae Park
Quoted 70 lines · On Sun, 3 Aug 2025 13:43:03 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae,

Quoted 36 lines · SeongJae Park
Quoted 34 lines · On Sun, 3 Aug 2025 11:03:12 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae and Sang-Heon,

Quoted 31 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

I'm unsure to what point you are saying "no". Are you saying DAMOS_PAGEOUT can also do demotion when demotion_enabled is set? Or not? Could you please clarify, and add more explanations about why you think so?

I checked it again and found I pointed out in the wrong place. Please see below.

Quoted 5 lines
Quoted 5 lines

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

Quoted 7 lines
Quoted 5 lines

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

I'm again get confused. Isn't it opposite?

The thing is that DAMOS_PAGEOUT call sequence is as follows.

    DAMOS_PAGEOUT
    -> damon_pa_pageout
    -> reclaim_pages
    -> reclaim_folio_list
Quoted 5 lines
Quoted 2 lines

In reclaim_folio_list(), it sets "no_demotion = 1" in scan_control, then invokes shrink_folio_list().

Thank you, this clarifies. DAMOS_PAGEOUT doesn't demote pages even if demotion_enabled is set. Thank you for enlightening me.

Thank you too. Glad to hear that.

Quoted 5 lines

So, "reclaim" means "reclaim". shrink_folio_list() can do demotions when demotion_enabled is set. I hence still don't think this patch is saying something very wrong, and how it could be improved. Do you have more specific change suggestions for this patch for an improvment?

I would just like to make the term "reclaim" clearer and we may be able to define what "reclaim" is. I think we can choose between the following two different definitions.

Definition 1. "reclaim" includes "pageout" and "demotion".
In this case, we better clarify all the other documents that mentions about those terms.

Definition 2. "reclaim" only includes "pageout", but "demotion" is out of scope. In this case, shrink_folio_list just do pageout, but "demotion" is only exceptional case so we can say the "demotion" escapes from "reclaim" logic.

We might have to clarify the term "reclaim" for those cases whether it includes "demotion" or not. We might have to discuss with other mm developers together.

Thanks,
Honggyu

#10 lore raw

Hi, SeongJae and Honggyu,

Quoted 98 lines · Honggyu Kim
Quoted 72 lines · SeongJae Park
Quoted 70 lines · On Sun, 3 Aug 2025 13:43:03 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae,

Quoted 36 lines · SeongJae Park
Quoted 34 lines · On Sun, 3 Aug 2025 11:03:12 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae and Sang-Heon,

Quoted 31 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

I'm unsure to what point you are saying "no". Are you saying DAMOS_PAGEOUT can also do demotion when demotion_enabled is set? Or not? Could you please clarify, and add more explanations about why you think so?

I checked it again and found I pointed out in the wrong place. Please see below.

Quoted 5 lines
Quoted 5 lines

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

Quoted 7 lines
Quoted 5 lines

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

I'm again get confused. Isn't it opposite?

The thing is that DAMOS_PAGEOUT call sequence is as follows.

    DAMOS_PAGEOUT
    -> damon_pa_pageout
    -> reclaim_pages
    -> reclaim_folio_list
Quoted 5 lines
Quoted 2 lines

In reclaim_folio_list(), it sets "no_demotion = 1" in scan_control, then invokes shrink_folio_list().

Thank you, this clarifies. DAMOS_PAGEOUT doesn't demote pages even if demotion_enabled is set. Thank you for enlightening me.

Thank you too. Glad to hear that.

Quoted 5 lines

So, "reclaim" means "reclaim". shrink_folio_list() can do demotions when demotion_enabled is set. I hence still don't think this patch is saying something very wrong, and how it could be improved. Do you have more specific change suggestions for this patch for an improvment?

I would just like to make the term "reclaim" clearer and we may be able to define what "reclaim" is. I think we can choose between the following two different definitions.

Definition 1. "reclaim" includes "pageout" and "demotion".
In this case, we better clarify all the other documents that mentions about those terms.

Quoted 8 lines

Definition 2. "reclaim" only includes "pageout", but "demotion" is out of scope. In this case, shrink_folio_list just do pageout, but "demotion" is only exceptional case so we can say the "demotion" escapes from "reclaim" logic.

We might have to clarify the term "reclaim" for those cases whether it includes "demotion" or not. We might have to discuss with other mm developers together. Thanks,
Honggyu

Because of the above thread, I got to know the details more clearly. Thank you guys!
When the discussion of "reclaim" finishes, I'll make v2 patch as soon as possible.

However, I want to talk about a slightly different topic. How about adding support demotion to DAMOS operation action?
Maybe we can add another action type or change implementation of DAMOS_PAGEOUT.

IMHO, I think we should first check whether it's possible to set no_demotion in the madvise -> foilo flow we're using. Since I'm still quite new to these things, I'd like to check whether my idea and direction are correct.

I can't thank you all enough for your kindness :)

Best Regards.
Sang-Heon Jeon

maintainer
#11 lore raw
Quoted 104 lines · On Sun, 3 Aug 2025 22:22:05 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, SeongJae and Honggyu,

Quoted 101 lines · Honggyu Kim
Quoted 72 lines · SeongJae Park
Quoted 70 lines · On Sun, 3 Aug 2025 13:43:03 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae,

Quoted 36 lines · SeongJae Park
Quoted 34 lines · On Sun, 3 Aug 2025 11:03:12 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae and Sang-Heon,

Quoted 31 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

I'm unsure to what point you are saying "no". Are you saying DAMOS_PAGEOUT can also do demotion when demotion_enabled is set? Or not? Could you please clarify, and add more explanations about why you think so?

I checked it again and found I pointed out in the wrong place. Please see below.

Quoted 5 lines
Quoted 5 lines

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

Quoted 7 lines
Quoted 5 lines

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

I'm again get confused. Isn't it opposite?

The thing is that DAMOS_PAGEOUT call sequence is as follows.

    DAMOS_PAGEOUT
    -> damon_pa_pageout
    -> reclaim_pages
    -> reclaim_folio_list
Quoted 5 lines
Quoted 2 lines

In reclaim_folio_list(), it sets "no_demotion = 1" in scan_control, then invokes shrink_folio_list().

Thank you, this clarifies. DAMOS_PAGEOUT doesn't demote pages even if demotion_enabled is set. Thank you for enlightening me.

Thank you too. Glad to hear that.

Quoted 5 lines

So, "reclaim" means "reclaim". shrink_folio_list() can do demotions when demotion_enabled is set. I hence still don't think this patch is saying something very wrong, and how it could be improved. Do you have more specific change suggestions for this patch for an improvment?

I would just like to make the term "reclaim" clearer and we may be able to define what "reclaim" is. I think we can choose between the following two different definitions.

Definition 1. "reclaim" includes "pageout" and "demotion".
In this case, we better clarify all the other documents that mentions about those terms.

Definition 2. "reclaim" only includes "pageout", but "demotion" is out of scope. In this case, shrink_folio_list just do pageout, but "demotion" is only exceptional case so we can say the "demotion" escapes from "reclaim" logic.

I was thinking in the first way, and apparently I was simply wrong. Now I think the second one is more correct, at least for {DAMOS,MADV}_PAGEOUT.

Yet another way to do the reclaim would be memory.reclaim cgroup file. Seems in the case, demotion can happen since user_proactive_reclaim() doesn't set scan_control->no_demotion.

I didn't read the code, but apparently memory pressure-based reactive traditional reclaim logic would also do demotion?

So, apparently "reclaim" can mean at least the two definitions.

Quoted 3 lines
Quoted 3 lines

We might have to clarify the term "reclaim" for those cases whether it includes "demotion" or not. We might have to discuss with other mm developers together.

I think that could be a nice discussion. Looking forward to. As I previously mentioned, I don't think we need to have only 1:1 mapping terminologies, though I have no strong opinion here.

Regardless of terms, I agree there are many rooms to improve on our documentation. At least DAMOS_PAGEOUT documentation may better to clarify what you pointed out.

Quoted 7 lines
Quoted 2 lines

Thanks,
Honggyu

Because of the above thread, I got to know the details more clearly. Thank you guys!
When the discussion of "reclaim" finishes, I'll make v2 patch as soon as possible.

I don't think we need to block v2 of this patch for the discussion. What about adding a note about the demotion behavior on the details comment second, e.g.,

include/linux/damon.h +2 -0
@@ -150,6 +150,8 @@ struct damon_access_report {
  * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
  * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
  * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ *
+ * Note that DAMOS_PAGEOUT doesn't trigger demotions.
  */
 enum damos_action {
        DAMOS_WILLNEED,
Quoted 4 lines

However, I want to talk about a slightly different topic. How about adding support demotion to DAMOS operation action?
Maybe we can add another action type or change implementation of DAMOS_PAGEOUT.

We actually tried to implement DAMOS_DEMOTE, but eventually decided[1] to have a more general action called DAMOS_MIGRATE_COLD.

Do you think there are use cases where DAMOS_MIGRATE_COLD cannot cover?

Quoted 7 lines

IMHO, I think we should first check whether it's possible to set no_demotion in the madvise -> foilo flow we're using. Since I'm still quite new to these things, I'd like to check whether my idea and direction are correct.

I can't thank you all enough for your kindness :)

The pleasure is mine :)

Quoted 4 lines

Best Regards.
Sang-Heon Jeon

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
SJ

#12 lore raw
Quoted 135 lines · SeongJae Park
Quoted 104 lines · On Sun, 3 Aug 2025 22:22:05 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, SeongJae and Honggyu,

Quoted 101 lines · Honggyu Kim
Quoted 72 lines · SeongJae Park
Quoted 70 lines · On Sun, 3 Aug 2025 13:43:03 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae,

Quoted 36 lines · SeongJae Park
Quoted 34 lines · On Sun, 3 Aug 2025 11:03:12 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae and Sang-Heon,

Quoted 31 lines · SeongJae Park
Quoted 14 lines · On Sat, 2 Aug 2025 01:11:09 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, Honggyu

Quoted 11 lines · Honggyu Kim

Hi Sang-Heon and SeongJae,

Quoted 7 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

[...]

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/linux/damon.h +0 -0

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

* @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED.
* @DAMOS_COLD: Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT: Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT: Reclaim the region.

Nice!

But doesn't it make confusion about whether this pages out to disk or does demotion to the lower tier memory? It's because PAGEOUT action doesn't do demotion, but it looks "reclaim" includes pageout and demotion together in my understanding since /sys/kernel/mm/numa/demotion_enabled was introduced.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

To my understanding, DAMOS_PAGEOUT can also do demotion when demotion_enabled is set. Am I missing something?

Actually no, please see below.

I'm unsure to what point you are saying "no". Are you saying DAMOS_PAGEOUT can also do demotion when demotion_enabled is set? Or not? Could you please clarify, and add more explanations about why you think so?

I checked it again and found I pointed out in the wrong place. Please see below.

Quoted 5 lines
Quoted 5 lines

do_demote_pass in shrink_folio_list()
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1122

Quoted 7 lines
Quoted 5 lines

The do_demote_pass is used here.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L1293-L1302

can_demote() implementation returns false when demotion_enabled is on.
https://github.com/torvalds/linux/blob/v6.16/mm/vmscan.c#L350-L351

I'm again get confused. Isn't it opposite?

The thing is that DAMOS_PAGEOUT call sequence is as follows.

    DAMOS_PAGEOUT
    -> damon_pa_pageout
    -> reclaim_pages
    -> reclaim_folio_list
Quoted 5 lines
Quoted 2 lines

In reclaim_folio_list(), it sets "no_demotion = 1" in scan_control, then invokes shrink_folio_list().

Thank you, this clarifies. DAMOS_PAGEOUT doesn't demote pages even if demotion_enabled is set. Thank you for enlightening me.

Thank you too. Glad to hear that.

Quoted 5 lines

So, "reclaim" means "reclaim". shrink_folio_list() can do demotions when demotion_enabled is set. I hence still don't think this patch is saying something very wrong, and how it could be improved. Do you have more specific change suggestions for this patch for an improvment?

I would just like to make the term "reclaim" clearer and we may be able to define what "reclaim" is. I think we can choose between the following two different definitions.

Definition 1. "reclaim" includes "pageout" and "demotion".
In this case, we better clarify all the other documents that mentions about those terms.

Definition 2. "reclaim" only includes "pageout", but "demotion" is out of scope. In this case, shrink_folio_list just do pageout, but "demotion" is only exceptional case so we can say the "demotion" escapes from "reclaim" logic.

I was thinking in the first way, and apparently I was simply wrong. Now I think the second one is more correct, at least for {DAMOS,MADV}_PAGEOUT.

Yet another way to do the reclaim would be memory.reclaim cgroup file. Seems in the case, demotion can happen since user_proactive_reclaim() doesn't set scan_control->no_demotion.

I didn't read the code, but apparently memory pressure-based reactive traditional reclaim logic would also do demotion?

So, apparently "reclaim" can mean at least the two definitions.

Quoted 3 lines
Quoted 3 lines

We might have to clarify the term "reclaim" for those cases whether it includes "demotion" or not. We might have to discuss with other mm developers together.

I think that could be a nice discussion. Looking forward to. As I previously mentioned, I don't think we need to have only 1:1 mapping terminologies, though I have no strong opinion here.

Regardless of terms, I agree there are many rooms to improve on our documentation. At least DAMOS_PAGEOUT documentation may better to clarify what you pointed out.

Quoted 3 lines
Quoted 2 lines

Thanks,
Honggyu

Quoted 7 lines
Quoted 4 lines

Because of the above thread, I got to know the details more clearly. Thank you guys!
When the discussion of "reclaim" finishes, I'll make v2 patch as soon as possible.

I don't think we need to block v2 of this patch for the discussion. What about adding a note about the demotion behavior on the details comment second, e.g.,

I see. That sounds reasonable because we can revisit after the discussion finishes.

Quoted 13 lines
include/linux/damon.h +2 -0
@@ -150,6 +150,8 @@ struct damon_access_report {
  * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
  * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
  * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ *
+ * Note that DAMOS_PAGEOUT doesn't trigger demotions.
  */
 enum damos_action {
        DAMOS_WILLNEED,
Quoted 2 lines
Quoted 8 lines
Quoted 3 lines

However, I want to talk about a slightly different topic. How about adding support demotion to DAMOS operation action?
Maybe we can add another action type or change implementation of DAMOS_PAGEOUT.

We actually tried to implement DAMOS_DEMOTE, but eventually decided[1] to have a more general action called DAMOS_MIGRATE_COLD.

Do you think there are use cases where DAMOS_MIGRATE_COLD cannot cover?

Thanks for your comments. Above suggestion was based on my lack of knowledge of DAMON.
I tracked linked RFC threads; now I understand that DAMOS_MIGRATE_COLD supports both demotion or lateral migration, depending on the environment.

Maybe there could be a new use case, but I think now it's not at the moment. It's just my bad :( let's just skip that suggestion.

Quoted 15 lines
Quoted 7 lines

IMHO, I think we should first check whether it's possible to set no_demotion in the madvise -> foilo flow we're using. Since I'm still quite new to these things, I'd like to check whether my idea and direction are correct.

I can't thank you all enough for your kindness :)

The pleasure is mine :)

Quoted 4 lines

Best Regards.
Sang-Heon Jeon

Quoted 5 lines

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
SJ

Best Regards.
Sang-Heon Jeon

#13 lore raw
In reply to SeongJae Park

Hi SeongJae,

Quoted 14 lines · SeongJae Park
Quoted 12 lines · On Sun, 3 Aug 2025 22:22:05 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, SeongJae and Honggyu,

Quoted 9 lines · Honggyu Kim
Quoted 5 lines · SeongJae Park
Quoted 3 lines · On Sun, 3 Aug 2025 13:43:03 +0900 Honggyu Kim <[email protected]> wrote:

Hi SeongJae,

On 8/3/2025 1:22 PM, SeongJae Park wrote:

[...snip...]

Quoted 33 lines
Quoted 25 lines
Quoted 25 lines
Quoted 7 lines
Quoted 7 lines

The thing is that DAMOS_PAGEOUT call sequence is as follows.

     DAMOS_PAGEOUT
     -> damon_pa_pageout
     -> reclaim_pages
     -> reclaim_folio_list
Quoted 5 lines
Quoted 2 lines

In reclaim_folio_list(), it sets "no_demotion = 1" in scan_control, then invokes shrink_folio_list().

Thank you, this clarifies. DAMOS_PAGEOUT doesn't demote pages even if demotion_enabled is set. Thank you for enlightening me.

Thank you too. Glad to hear that.

Quoted 5 lines

So, "reclaim" means "reclaim". shrink_folio_list() can do demotions when demotion_enabled is set. I hence still don't think this patch is saying something very wrong, and how it could be improved. Do you have more specific change suggestions for this patch for an improvment?

I would just like to make the term "reclaim" clearer and we may be able to define what "reclaim" is. I think we can choose between the following two different definitions.

Quoted 7 lines
Quoted 7 lines

Definition 1. "reclaim" includes "pageout" and "demotion".
In this case, we better clarify all the other documents that mentions about those terms.

Definition 2. "reclaim" only includes "pageout", but "demotion" is out of scope. In this case, shrink_folio_list just do pageout, but "demotion" is only exceptional case so we can say the "demotion" escapes from "reclaim" logic.

Quoted 6 lines

I was thinking in the first way, and apparently I was simply wrong. Now I think the second one is more correct, at least for {DAMOS,MADV}_PAGEOUT.

Yet another way to do the reclaim would be memory.reclaim cgroup file. Seems in the case, demotion can happen since user_proactive_reclaim() doesn't set scan_control->no_demotion.

If so, we can't limit the meaning of reclaim into only pageout.

Quoted 3 lines

I didn't read the code, but apparently memory pressure-based reactive traditional reclaim logic would also do demotion?

Not sure about "traditional" reclaim logic but demotion logic was introduced not a long time ago. The meaning of demotion is meaningful only for tiered memory system. I remember tiered memory concept was introduced only about 2+ years ago.

Quoted 2 lines

So, apparently "reclaim" can mean at least the two definitions.

Yeah, I would like to clarify the definition and make our function names clearer for better readability.

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

We might have to clarify the term "reclaim" for those cases whether it includes "demotion" or not. We might have to discuss with other mm developers together.

Quoted 7 lines

I think that could be a nice discussion. Looking forward to. As I previously mentioned, I don't think we need to have only 1:1 mapping terminologies, though I have no strong opinion here.

Regardless of terms, I agree there are many rooms to improve on our documentation. At least DAMOS_PAGEOUT documentation may better to clarify what you pointed out.

I don't have strong objection now even if DAMOS_PAGEOUT uses the term "reclaim" for now. I think it will take some time so will leave it for now because I cannot put this into my top priority list due to other works.

Quoted 11 lines
Quoted 8 lines
Quoted 3 lines

Thanks,
Honggyu

Because of the above thread, I got to know the details more clearly. Thank you guys!
When the discussion of "reclaim" finishes, I'll make v2 patch as soon as possible.

I don't think we need to block v2 of this patch for the discussion. What about adding a note about the demotion behavior on the details comment second, e.g.,

Agreed.

Quoted 24 lines
include/linux/damon.h +2 -0
@@ -150,6 +150,8 @@ struct damon_access_report {
   * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
   * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
   * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ *
+ * Note that DAMOS_PAGEOUT doesn't trigger demotions.
   */
  enum damos_action {
         DAMOS_WILLNEED,
Quoted 5 lines

However, I want to talk about a slightly different topic. How about adding support demotion to DAMOS operation action?
Maybe we can add another action type or change implementation of DAMOS_PAGEOUT.

We actually tried to implement DAMOS_DEMOTE, but eventually decided[1] to have a more general action called DAMOS_MIGRATE_COLD.

Do you think there are use cases where DAMOS_MIGRATE_COLD cannot cover?

Quoted 1 line
Quoted 8 lines
Quoted 6 lines

IMHO, I think we should first check whether it's possible to set no_demotion in the madvise -> foilo flow we're using. Since I'm still quite new to these things, I'd like to check whether my idea and direction are correct.

I can't thank you all enough for your kindness :)

The pleasure is mine :)

mine too :)

Thanks,
Honggyu

Quoted 11 lines
Quoted 5 lines

Best Regards.
Sang-Heon Jeon

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
SJ

#14 lore raw
In reply to SeongJae Park

Hi, SeongJae

Quoted 10 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

Thank you for catching this and fixing!

:)

Quoted 11 lines
Quoted 5 lines

---
I also found below patch(https://lore.kernel.org/damon/[email protected]/T/#t) So, Is it means that DAMOS_STAT is only supported by paddr now?

No. 'vaddr' supports DAMOS_STAT. The patch is not adding DAMOS_STAT support on vaddr, but extending the support for DAMOS filters.

Thank you for checking the thread and asking this question, though. I see this as an important signal of another rooms to improve on the documentation.

Thanks for your kind review. I really don't want to bother you anymore. But I would like to check my understanding.

So the basic operation of stat is covered by outside of damon_pa_apply_scheme and damon_va_apply_scheme.
If it's not too much trouble, could you point me to where they are?

And some extension stat (maybe it only renewed that filter exists) is covered inside of upper functions. Is it also right point?

Quoted 11 lines
Quoted 11 lines

If my understanding is correct, then we need to fix Design documentation and comments both.

However, since it will be fixed soon. Keeping current status is also affordable. So could you check this point as well?

---

 include/linux/damon.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 9 lines

include/linux/damon.h struct damon_access_report {

Quoted 5 lines
include/linux/damon.h +0 -0
index cddf82eaac4e..0870e9f48b0f 100644
@@ -128,7 +128,7 @@ struct damon_access_report {

Seems you are using damon/next as your baseline. If there is no real dependencies to damon/next, please use mm-new as your baseline. For more contexts about that, please refer to the DAMON maintainer-profile[1].

I see. I'll keep this in my mind. Thank you for telling me!

Quoted 22 lines

include/linux/damon.h struct damon_access_report { · line 131

Quoted 5 lines
include/linux/damon.h +1 -1
  *
  * @DAMOS_WILLNEED:  Call ``madvise()`` for the region with MADV_WILLNEED.
  * @DAMOS_COLD:              Call ``madvise()`` for the region with MADV_COLD.
- * @DAMOS_PAGEOUT:   Call ``madvise()`` for the region with MADV_PAGEOUT.
+ * @DAMOS_PAGEOUT:   Reclaim the region.

Nice!

include/linux/damon.h struct damon_access_report { · line 150

Quoted 11 lines
include/linux/damon.h +2 -2
  * @DAMOS_HUGEPAGE:  Call ``madvise()`` for the region with MADV_HUGEPAGE.
  * @DAMOS_NOHUGEPAGE:        Call ``madvise()`` for the region with MADV_NOHUGEPAGE.
  * @DAMOS_LRU_PRIO:  Prioritize the region on its LRU lists.
@@ -146,8 +146,8 @@ struct damon_access_report {
  * The support of each action is up to running &struct damon_operations.
  * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
  * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO.  &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * supports all actions except &enum DAMOS_WILLNEED, &enum DAMOS_COLD,
+ * &enum DAMOS_HUGEPAGE, &enum DAMOS_NOHUGEPAGE.

Thank you for updating this!

Quoted 5 lines

But, now I find this place is having outdated information that partially duplicated with the DAMON design document[2]. I think the design document is better to maintain this kind of details. What about keeping the high level information but giving a reference to the documentation for details, for example, like below?

I totally agree with you. Unexpected duplication sometimes leads to unexpected expiration like this one
So, I think that I need to send v2 patch, If that's right, which way would you prefer?
reply to this thread or make a new thread?

Quoted 14 lines

@@ -143,11 +143,9 @@ struct damon_access_report {
* @DAMOS_STAT: Do nothing but count the stat.
* @NR_DAMOS_ACTIONS: Total number of DAMOS actions
*
- * The support of each action is up to running &struct damon_operations.
- * &enum DAMON_OPS_VADDR and &enum DAMON_OPS_FVADDR supports all actions except
- * &enum DAMOS_LRU_PRIO and &enum DAMOS_LRU_DEPRIO. &enum DAMON_OPS_PADDR
- * supports only &enum DAMOS_PAGEOUT, &enum DAMOS_LRU_PRIO, &enum
- * DAMOS_LRU_DEPRIO, and &DAMOS_STAT.
+ * The support of each action is up to running &struct damon_operations. Refer
+ * to 'Operation Action' section of Documentation/mm/damon/design.rst for
+ * status of the supports.
*/

Quoted 6 lines

Thanks,
SJ

[1] https://origin.kernel.org/doc/html/next/mm/damon/maintainer-profile.html#scm-trees
[2] https://origin.kernel.org/doc/html/next/mm/damon/design.html#operation-action

Best Regards.
Sang-Heon Jeon

maintainer
#15 lore raw
Quoted 22 lines · On Sat, 2 Aug 2025 00:34:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, SeongJae

Quoted 10 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

Thank you for catching this and fixing!

:)

Quoted 6 lines
Quoted 5 lines

---
I also found below patch(https://lore.kernel.org/damon/[email protected]/T/#t) So, Is it means that DAMOS_STAT is only supported by paddr now?

Quoted 8 lines
Quoted 5 lines

No. 'vaddr' supports DAMOS_STAT. The patch is not adding DAMOS_STAT support on vaddr, but extending the support for DAMOS filters.

Thank you for checking the thread and asking this question, though. I see this as an important signal of another rooms to improve on the documentation.

Thanks for your kind review. I really don't want to bother you anymore. But I would like to check my understanding.

No worry, questions about DAMON never bother me.

Quoted 4 lines

So the basic operation of stat is covered by outside of damon_pa_apply_scheme and damon_va_apply_scheme.
If it's not too much trouble, could you point me to where they are?

It is covered by damos_update_stat() in core.c file.

Quoted 3 lines

And some extension stat (maybe it only renewed that filter exists) is covered inside of upper functions. Is it also right point?

Depending on what you mean with "upper functions".

damos_apply_scheme() in DAMON core layer calls damon_operationss->apply_scheme() callback of the current operations set. The callback may handle DAMOS filters or not. The callback of paddr.c handles the filters for DAMOS_STAT. The callback of vaddr.c does not, and Pan is extending it to handle filters.

[...]

Quoted 3 lines

So, I think that I need to send v2 patch, If that's right, which way would you prefer?
reply to this thread or make a new thread?

I prefer making a new thread :)

Thanks,
SJ

[...]

#16 lore raw
Quoted 34 lines · SeongJae Park
Quoted 22 lines · On Sat, 2 Aug 2025 00:34:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Hi, SeongJae

Quoted 10 lines · SeongJae Park

Hello Sang-Heon,

Quoted 3 lines · On Thu, 31 Jul 2025 22:22:30 +0900 Sang-Heon Jeon <[email protected]> wrote:

Nowadays, damos operation actions support more various operation set. But comments(also, generated documentation) doesn't updated. So, fix the comments with current support status.

Thank you for catching this and fixing!

:)

Quoted 6 lines
Quoted 5 lines

---
I also found below patch(https://lore.kernel.org/damon/[email protected]/T/#t) So, Is it means that DAMOS_STAT is only supported by paddr now?

Quoted 8 lines
Quoted 5 lines

No. 'vaddr' supports DAMOS_STAT. The patch is not adding DAMOS_STAT support on vaddr, but extending the support for DAMOS filters.

Thank you for checking the thread and asking this question, though. I see this as an important signal of another rooms to improve on the documentation.

Thanks for your kind review. I really don't want to bother you anymore. But I would like to check my understanding.

Quoted 8 lines

No worry, questions about DAMON never bother me.

Quoted 4 lines

So the basic operation of stat is covered by outside of damon_pa_apply_scheme and damon_va_apply_scheme.
If it's not too much trouble, could you point me to where they are?

It is covered by damos_update_stat() in core.c file.

Oh, I see, Now I can understand the flow more deeply :)

Quoted 11 lines
Quoted 3 lines

And some extension stat (maybe it only renewed that filter exists) is covered inside of upper functions. Is it also right point?

Depending on what you mean with "upper functions".

damos_apply_scheme() in DAMON core layer calls damon_operationss->apply_scheme() callback of the current operations set. The callback may handle DAMOS filters or not. The callback of paddr.c handles the filters for DAMOS_STAT. The callback of vaddr.c does not, and Pan is extending it to handle filters.

Oh, I see. Thanks to your help, Now i figure out the flow from sysfs(or directly set) to damon_select_ops().

Quoted 7 lines

[...]

Quoted 3 lines

So, I think that I need to send v2 patch, If that's right, which way would you prefer?
reply to this thread or make a new thread?

I prefer making a new thread :)

When the discussion of "reclaim" finishes, I'll make v2 patch as soon as possible.

Quoted 4 lines

Thanks,
SJ

[...]

Thanks for your kindness.

Best Regards.
Sang-Heon Jeon

maintainer
#17 lore raw

On Sun, 3 Aug 2025 21:44:10 +0900 Sang-Heon Jeon <[email protected]> wrote:

[...]

Quoted 2 lines

When the discussion of "reclaim" finishes, I'll make v2 patch as soon as possible.

As mentioned on the other reply, I don't think the v2 should be blocked for the discussion, unless Honggyu or others object.

Thanks,
SJ

[...]