Implement a DAMON core API for reporting page fault events to DAMON. It
is a wrapper of damon_report_access().
This is a temporal hack. In future versions that will have no RFC tag,
only damon_report_access() may be used.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
include/linux/damon.h | 10 ++++++++++
mm/damon/core.c | 17 +++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/include/linux/damon.h b/include/linux/damon.h
index b9359c76a6f1..b8ebb2aa02c8 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -1017,6 +1017,13 @@ int damon_call(struct damon_ctx *ctx, struct damon_call_control *control);
int damos_walk(struct damon_ctx *ctx, struct damos_walk_control *control);
void damon_report_access(struct damon_access_report *report);
+#ifdef CONFIG_MMU
+void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd);
+#else
+static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
+{
+}
+#endif
int damon_set_region_biggest_system_ram_default(struct damon_target *t,
unsigned long *start, unsigned long *end,
@@ -1027,6 +1034,9 @@ int damon_set_region_biggest_system_ram_default(struct damon_target *t,
static inline void damon_report_access(struct damon_access_report *report)
{
}
+static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
+{
+}
#endif /* CONFIG_DAMON */
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 89305d42e116..296117d5e7f7 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1579,6 +1579,23 @@ void damon_report_access(struct damon_access_report *report)
mutex_unlock(&damon_access_reports_lock);
}
+#ifdef CONFIG_MMU
+void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
+{
+ struct damon_access_report access_report = {
+ .size = 1, /* todo: set appripriately */
+ };
+
+ if (huge_pmd)
+ access_report.addr = PFN_PHYS(pmd_pfn(vmf->orig_pmd));
+ else
+ access_report.addr = PFN_PHYS(pte_pfn(vmf->orig_pte));
+ /* todo: report vmf->address as virtual address */
+
+ damon_report_access(&access_report);
+}
+#endif
+
/*
* Warn and fix corrupted ->nr_accesses[_bp] for investigations and preventing
* the problem being propagated.
--
2.47.3
On Mon, 8 Dec 2025 at 15:33, SeongJae Park <sj@kernel.org> wrote:
>
> Implement a DAMON core API for reporting page fault events to DAMON. It
> is a wrapper of damon_report_access().
>
> This is a temporal hack. In future versions that will have no RFC tag,
> only damon_report_access() may be used.
It's a minor, but git am throws an error when applying the [RFC PATCH v3 04/37]
patch file. I am testing it by modifying it as follows.
damon_report_access() is
called by damon_report_page_fault(), so they depend on each other.
#ifdef CONFIG_MMU
void damon_report_access(struct damon_access_report *report);
void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd);
#else
static inline void damon_report_access(struct damon_access_report *report)
{
}
static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
{
}
#endif
Thanks,
JaeJoon
>
> Signed-off-by: SeongJae Park <sj@kernel.org>
> ---
> include/linux/damon.h | 10 ++++++++++
> mm/damon/core.c | 17 +++++++++++++++++
> 2 files changed, 27 insertions(+)
>
> diff --git a/include/linux/damon.h b/include/linux/damon.h
> index b9359c76a6f1..b8ebb2aa02c8 100644
> --- a/include/linux/damon.h
> +++ b/include/linux/damon.h
> @@ -1017,6 +1017,13 @@ int damon_call(struct damon_ctx *ctx, struct damon_call_control *control);
> int damos_walk(struct damon_ctx *ctx, struct damos_walk_control *control);
>
> void damon_report_access(struct damon_access_report *report);
> +#ifdef CONFIG_MMU
> +void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd);
> +#else
> +static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
> +{
> +}
> +#endif
>
> int damon_set_region_biggest_system_ram_default(struct damon_target *t,
> unsigned long *start, unsigned long *end,
> @@ -1027,6 +1034,9 @@ int damon_set_region_biggest_system_ram_default(struct damon_target *t,
> static inline void damon_report_access(struct damon_access_report *report)
> {
> }
> +static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
> +{
> +}
>
> #endif /* CONFIG_DAMON */
>
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index 89305d42e116..296117d5e7f7 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -1579,6 +1579,23 @@ void damon_report_access(struct damon_access_report *report)
> mutex_unlock(&damon_access_reports_lock);
> }
>
> +#ifdef CONFIG_MMU
> +void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
> +{
> + struct damon_access_report access_report = {
> + .size = 1, /* todo: set appripriately */
> + };
> +
> + if (huge_pmd)
> + access_report.addr = PFN_PHYS(pmd_pfn(vmf->orig_pmd));
> + else
> + access_report.addr = PFN_PHYS(pte_pfn(vmf->orig_pte));
> + /* todo: report vmf->address as virtual address */
> +
> + damon_report_access(&access_report);
> +}
> +#endif
> +
> /*
> * Warn and fix corrupted ->nr_accesses[_bp] for investigations and preventing
> * the problem being propagated.
> --
> 2.47.3
>
On Fri, 12 Dec 2025 21:46:03 +0900 JaeJoon Jung <rgbi3307@gmail.com> wrote:
> On Mon, 8 Dec 2025 at 15:33, SeongJae Park <sj@kernel.org> wrote:
> >
> > Implement a DAMON core API for reporting page fault events to DAMON. It
> > is a wrapper of damon_report_access().
> >
> > This is a temporal hack. In future versions that will have no RFC tag,
> > only damon_report_access() may be used.
>
> It's a minor, but git am throws an error when applying the [RFC PATCH v3 04/37]
> patch file.
Interesting. I can do 'git am' this patch without error on mm-new branch. Are
you using something other than mm-new as your baseline?
> I am testing it by modifying it as follows.
> damon_report_access() is
> called by damon_report_page_fault(), so they depend on each other.
>
> #ifdef CONFIG_MMU
> void damon_report_access(struct damon_access_report *report);
> void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd);
> #else
> static inline void damon_report_access(struct damon_access_report *report)
> {
> }
> static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
> {
> }
> #endif
Seems this is not for fixing a 'git am' error but build error...? Can you
share what error exactly you are seeing?
Thanks,
SJ
[...]
On Sat, 13 Dec 2025 at 07:47, SeongJae Park <sj@kernel.org> wrote:
>
> On Fri, 12 Dec 2025 21:46:03 +0900 JaeJoon Jung <rgbi3307@gmail.com> wrote:
>
> > On Mon, 8 Dec 2025 at 15:33, SeongJae Park <sj@kernel.org> wrote:
> > >
> > > Implement a DAMON core API for reporting page fault events to DAMON. It
> > > is a wrapper of damon_report_access().
> > >
> > > This is a temporal hack. In future versions that will have no RFC tag,
> > > only damon_report_access() may be used.
> >
> > It's a minor, but git am throws an error when applying the [RFC PATCH v3 04/37]
> > patch file.
>
> Interesting. I can do 'git am' this patch without error on mm-new branch. Are
> you using something other than mm-new as your baseline?
>
> > I am testing it by modifying it as follows.
> > damon_report_access() is
> > called by damon_report_page_fault(), so they depend on each other.
> >
> > #ifdef CONFIG_MMU
> > void damon_report_access(struct damon_access_report *report);
> > void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd);
> > #else
> > static inline void damon_report_access(struct damon_access_report *report)
> > {
> > }
> > static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
> > {
> > }
> > #endif
>
> Seems this is not for fixing a 'git am' error but build error...? Can you
> share what error exactly you are seeing?
You have been deploying RFC PATCH v1, v2, and v3 starting from 2025-06-29.
I am currently working with the latest version v6.18.1 (as of 2025-12-13).
$ head Makefile
# SPDX-License-Identifier: GPL-2.0
VERSION = 6
PATCHLEVEL = 18
SUBLEVEL = 1
EXTRAVERSION =
NAME = Baby Opossum Posse
When applying RFC PATCH v1, v2, v3 with the above version, errors occur
in several places in 'git am' as follows.
-------- [RFC PATCH v1] -------------------------------------------------
$ git am '[RFC PATCH 1/6]'
Applying: mm/damon/core: introduce damon_report_access()
$ git am '[RFC PATCH 2/6]'
Applying: mm/damon/core: add eliglble_report() ops callback
$ git am '[RFC PATCH 3/6]'
Applying: mm/damon/core: check received access reports
$ git am '[RFC PATCH 4/6]'
Applying: mm/damon/vaddr: impleement eligible_report() callback
error: patch failed: mm/damon/vaddr.c:610
error: mm/damon/vaddr.c: patch does not apply
Patch failed at 0001 mm/damon/vaddr: impleement eligible_report() callback
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC PATCH 5/6]'
Applying: mm/damon: add node_id to damon_access_report
$ git am '[RFC PATCH 6/6]'
Applying: mm/damon: add write field to damon_access_report
-------- [RFC PATCH v2] -------------------------------------------------
$ git am '[RFC v2 1/7]'
Applying: mm/damon/core: introduce damon_report_access()
error: patch failed: include/linux/damon.h:104
error: include/linux/damon.h: patch does not apply
error: patch failed: mm/damon/core.c:24
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: introduce damon_report_access()
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v2 2/7]'
Applying: mm/damon/core: add eligible_report() ops callback
error: patch failed: include/linux/damon.h:590
error: include/linux/damon.h: patch does not apply
Patch failed at 0001 mm/damon/core: add eligible_report() ops callback
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v2 3/7]'
Applying: mm/damon/vaddr: implement eligible_report()
$ git am '[RFC v2 4/7]'
Applying: mm/damon/core: read received access reports
error: patch failed: mm/damon/core.c:2560
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: read received access reports
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v2 5/7]'
Applying: mm/memory: implement MM_CP_DAMON
$ git am '[RFC v2 6/7]'
Applying: mm/damon: implement paddr_fault operations set
$ git am '[RFC v2 7/7]'
Applying: mm/damon/sysfs: support paddr_fault
-------- [RFC PATCH v3] -------------------------------------------------
$ git am '[RFC v3 01/37]'
Applying: mm/damon/core: implement damon_report_access()
error: patch failed: include/linux/damon.h:110
error: include/linux/damon.h: patch does not apply
error: patch failed: mm/damon/core.c:20
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: implement damon_report_access()
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 02/37]'
Applying: mm/damon: define struct damon_sample_control
$ git am '[RFC v3 03/37]'
Applying: mm/damon/core: commit damon_sample_control
error: patch failed: mm/damon/core.c:1278
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: commit damon_sample_control
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 04/37]'
Applying: mm/damon/core: implement damon_report_page_fault()
error: patch failed: include/linux/damon.h:1017
error: include/linux/damon.h: patch does not apply
Patch failed at 0001 mm/damon/core: implement damon_report_page_fault()
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 05/37]'
Applying: mm/{mprotect,memory}: (no upstream-aimed hack) implement MM_CP_DAMON
error: patch failed: include/linux/mm.h:2848
error: include/linux/mm.h: patch does not apply
error: patch failed: mm/memory.c:78
error: mm/memory.c: patch does not apply
error: patch failed: mm/mprotect.c:651
error: mm/mprotect.c: patch does not apply
Patch failed at 0001 mm/{mprotect,memory}: (no upstream-aimed hack)
implement MM_CP_DAMON
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 06/37]'
Applying: mm/damon/paddr: support page fault access check primitive
error: patch failed: mm/damon/paddr.c:14
error: mm/damon/paddr.c: patch does not apply
Patch failed at 0001 mm/damon/paddr: support page fault access check primitive
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 07/37]'
Applying: mm/damon/core: apply access reports to high level snapshot
error: patch failed: mm/damon/core.c:2745
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: apply access reports to high level snapshot
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 08/37]'
Applying: mm/damon/sysfs: implement monitoring_attrs/sample/ dir
$ git am '[RFC v3 09/37]'
Applying: mm/damon/sysfs: implement sample/primitives/ dir
$ git am '[RFC v3 10/37]'
Applying: mm/damon/sysfs: connect primitives directory with core
$ git am '[RFC v3 11/37]'
Applying: Docs/mm/damon/design: document page fault sampling primitive
$ git am '[RFC v3 12/37]'
Applying: Docs/admin-guide/mm/damon/usage: document sample primitives dir
error: patch failed: Documentation/admin-guide/mm/damon/usage.rst:65
error: Documentation/admin-guide/mm/damon/usage.rst: patch does not apply
Patch failed at 0001 Docs/admin-guide/mm/damon/usage: document sample
primitives dir
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 13/37]'
Applying: mm/damon: extend damon_access_report for origin CPU reporting
error: patch failed: include/linux/damon.h:115
error: include/linux/damon.h: patch does not apply
Patch failed at 0001 mm/damon: extend damon_access_report for origin
CPU reporting
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 14/37]'
Applying: mm/damon/core: report access origin cpu of page faults
error: patch failed: mm/damon/core.c:1585
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: report access origin cpu of page faults
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 15/37]'
Applying: mm/damon: implement sample filter data structure for
cpus-only monitoring
$ git am '[RFC v3 16/37]'
Applying: mm/damon/core: implement damon_sample_filter manipulations
error: patch failed: mm/damon/core.c:561
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: implement damon_sample_filter manipulations
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 17/37]'
Applying: mm/damon/core: commit damon_sample_filters
error: patch failed: mm/damon/core.c:573
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: commit damon_sample_filters
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 18/37]'
Applying: mm/damon/core: apply sample filter to access reports
error: patch failed: mm/damon/core.c:586
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: apply sample filter to access reports
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 19/37]'
Applying: mm/damon/sysfs: implement sample/filters/ directory
$ git am '[RFC v3 20/37]'
Applying: mm/damon/sysfs: implement sample filter directory
$ git am '[RFC v3 21/37]'
Applying: mm/damon/sysfs: implement type, matching, allow files under
sample filter dir
$ git am '[RFC v3 22/37]'
Applying: mm/damon/sysfs: implement cpumask file under sample filter dir
$ git am '[RFC v3 23/37]'
Applying: mm/damon/sysfs: connect sample filters with core layer
$ git am '[RFC v3 24/37]'
Applying: Docs/mm/damon/design: document sample filters
$ git am '[RFC v3 25/37]'
Applying: Docs/admin-guide/mm/damon/usage: document sample filters dir
error: patch failed: Documentation/admin-guide/mm/damon/usage.rst:66
error: Documentation/admin-guide/mm/damon/usage.rst: patch does not apply
Patch failed at 0001 Docs/admin-guide/mm/damon/usage: document sample
filters dir
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 26/37]'
Applying: mm/damon: extend damon_access_report for access-origin thread info
error: patch failed: include/linux/damon.h:116
error: include/linux/damon.h: patch does not apply
Patch failed at 0001 mm/damon: extend damon_access_report for
access-origin thread info
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 27/37]'
Applying: mm/damon/core: report access-generated thread id of the fault event
error: patch failed: mm/damon/core.c:1712
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: report access-generated thread id
of the fault event
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 28/37]'
Applying: mm/damon: extend damon_sample_filter for threads
$ git am '[RFC v3 29/37]'
Applying: mm/damon/core: support threads type sample filter
error: patch failed: mm/damon/core.c:570
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: support threads type sample filter
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 30/37]'
Applying: mm/damon/sysfs: support thread based access sample filtering
$ git am '[RFC v3 31/37]'
Applying: Docs/mm/damon/design: document threads type sample filter
$ git am '[RFC v3 32/37]'
Applying: Docs/admin-guide/mm/damon/usage: document tids_arr file
error: patch failed: Documentation/admin-guide/mm/damon/usage.rst:67
error: Documentation/admin-guide/mm/damon/usage.rst: patch does not apply
Patch failed at 0001 Docs/admin-guide/mm/damon/usage: document tids_arr file
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 33/37]'
Applying: mm/damon: support reporting write access
error: patch failed: include/linux/damon.h:117
error: include/linux/damon.h: patch does not apply
Patch failed at 0001 mm/damon: support reporting write access
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 34/37]'
Applying: mm/damon/core: report whether the page fault was for writing
error: patch failed: mm/damon/core.c:1732
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: report whether the page fault was
for writing
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 35/37]'
Applying: mm/damon/core: support write access sample filter
error: patch failed: mm/damon/core.c:1336
error: mm/damon/core.c: patch does not apply
Patch failed at 0001 mm/damon/core: support write access sample filter
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --abort
$ git am '[RFC v3 36/37]'
Applying: mm/damon/sysfs: support write-type access sample filter
$ git am '[RFC v3 37/37]'
Applying: Docs/mm/damon/design: document write access sample filter type
If I build the kernel with the above status, I get compilation errors
as follows.
/home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c:758:25:
error: ‘DAMON_FILTER_TYPE_WRITE’ undeclared here (not in a function);
did you mean ‘DAMOS_FILTER_TYPE_TARGET’?
758 | .type = DAMON_FILTER_TYPE_WRITE,
| ^~~~~~~~~~~~~~~~~~~~~~~
| DAMOS_FILTER_TYPE_TARGET
/home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c: In function
‘damon_sysfs_set_sample_filters’:
/home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c:2014:26:
error: implicit declaration of function ‘damon_new_sample_filter’; did
you mean ‘damos_new_filter’? [-Werror=implicit-function-declaration]
2014 | filter = damon_new_sample_filter(
| ^~~~~~~~~~~~~~~~~~~~~~~
| damos_new_filter
/home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c:2014:24:
warning: assignment to ‘struct damon_sample_filter *’ from ‘int’ makes
pointer from integer without a cast [-Wint-conversion]
2014 | filter = damon_new_sample_filter(
| ^
/home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c:2027:33:
error: implicit declaration of function ‘damon_free_sample_filter’;
did you mean ‘damon_sysfs_set_sample_filters’?
[-Werror=implicit-function-declaration]
2027 | damon_free_sample_filter(filter);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| damon_sysfs_set_sample_filters
/home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c:2032:17:
error: implicit declaration of function ‘damon_add_sample_filter’; did
you mean ‘damos_add_filter’? [-Werror=implicit-function-declaration]
2032 | damon_add_sample_filter(control, filter);
| ^~~~~~~~~~~~~~~~~~~~~~~
| damos_add_filter
cc1: some warnings being treated as errors
make[5]: *** [/home/arm64/projects/kernel/linux-stable/scripts/Makefile.build:287:
mm/damon/sysfs.o] Error 1
make[4]: *** [/home/arm64/projects/kernel/linux-stable/scripts/Makefile.build:556:
mm/damon] Error 2
make[3]: *** [/home/arm64/projects/kernel/linux-stable/scripts/Makefile.build:556:
mm] Error 2
make[3]: *** Waiting for unfinished jobs....
CC kernel/time/timekeeping_debug.o
I am analyzing the source code while I am correcting the errors.
Thanks,
JaeJoon
>
>
> Thanks,
> SJ
>
> [...]
On Sat, 13 Dec 2025 09:31:22 +0900 JaeJoon Jung <rgbi3307@gmail.com> wrote:
> On Sat, 13 Dec 2025 at 07:47, SeongJae Park <sj@kernel.org> wrote:
> >
> > On Fri, 12 Dec 2025 21:46:03 +0900 JaeJoon Jung <rgbi3307@gmail.com> wrote:
> >
> > > On Mon, 8 Dec 2025 at 15:33, SeongJae Park <sj@kernel.org> wrote:
> > > >
> > > > Implement a DAMON core API for reporting page fault events to DAMON. It
> > > > is a wrapper of damon_report_access().
> > > >
> > > > This is a temporal hack. In future versions that will have no RFC tag,
> > > > only damon_report_access() may be used.
> > >
> > > It's a minor, but git am throws an error when applying the [RFC PATCH v3 04/37]
> > > patch file.
> >
> > Interesting. I can do 'git am' this patch without error on mm-new branch. Are
> > you using something other than mm-new as your baseline?
> >
> > > I am testing it by modifying it as follows.
> > > damon_report_access() is
> > > called by damon_report_page_fault(), so they depend on each other.
> > >
> > > #ifdef CONFIG_MMU
> > > void damon_report_access(struct damon_access_report *report);
> > > void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd);
> > > #else
> > > static inline void damon_report_access(struct damon_access_report *report)
> > > {
> > > }
> > > static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
> > > {
> > > }
> > > #endif
> >
> > Seems this is not for fixing a 'git am' error but build error...? Can you
> > share what error exactly you are seeing?
>
> You have been deploying RFC PATCH v1, v2, and v3 starting from 2025-06-29.
> I am currently working with the latest version v6.18.1 (as of 2025-12-13).
>
> $ head Makefile
> # SPDX-License-Identifier: GPL-2.0
> VERSION = 6
> PATCHLEVEL = 18
> SUBLEVEL = 1
> EXTRAVERSION =
> NAME = Baby Opossum Posse
>
> When applying RFC PATCH v1, v2, v3 with the above version, errors occur
> in several places in 'git am' as follows.
>
> -------- [RFC PATCH v1] -------------------------------------------------
>
> $ git am '[RFC PATCH 1/6]'
> Applying: mm/damon/core: introduce damon_report_access()
>
> $ git am '[RFC PATCH 2/6]'
> Applying: mm/damon/core: add eliglble_report() ops callback
>
> $ git am '[RFC PATCH 3/6]'
> Applying: mm/damon/core: check received access reports
>
> $ git am '[RFC PATCH 4/6]'
> Applying: mm/damon/vaddr: impleement eligible_report() callback
> error: patch failed: mm/damon/vaddr.c:610
> error: mm/damon/vaddr.c: patch does not apply
> Patch failed at 0001 mm/damon/vaddr: impleement eligible_report() callback
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
[...]
Thank you for sharing these! We are working on moving baseline, specifically
mm-new in most cases. And we keep under-development patches on damon/next
tree. Please refer to the document [1] for more details.
And a later version of the patch series is for replacing the old version. If
you have no special reason to apply the old versions of the patches, I'd
suggest to use only the latest version. And if you have no special reasons to
use only 6.18.1, I'd recommend to just play with the commits on damon/next
tree that was used to generate the patch files.
Nonetheless, if you have a strong reason to do work on only 6.18.1, please feel
free to ask help if needed.
> If I build the kernel with the above status, I get compilation errors
> as follows.
>
> /home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c:758:25:
> error: ‘DAMON_FILTER_TYPE_WRITE’ undeclared here (not in a function);
> did you mean ‘DAMOS_FILTER_TYPE_TARGET’?
> 758 | .type = DAMON_FILTER_TYPE_WRITE,
> | ^~~~~~~~~~~~~~~~~~~~~~~
> | DAMOS_FILTER_TYPE_TARGET
[...]
Makes sense. Again, I'd recommend using mm-new as your baseline or play with
the commits on damon/next, but if you need help, please feel free to reach out
:)
[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
[2]
Thanks,
SJ
[...]
On Sat, 13 Dec 2025 at 09:56, SeongJae Park <sj@kernel.org> wrote:
>
> On Sat, 13 Dec 2025 09:31:22 +0900 JaeJoon Jung <rgbi3307@gmail.com> wrote:
>
> > On Sat, 13 Dec 2025 at 07:47, SeongJae Park <sj@kernel.org> wrote:
> > >
> > > On Fri, 12 Dec 2025 21:46:03 +0900 JaeJoon Jung <rgbi3307@gmail.com> wrote:
> > >
> > > > On Mon, 8 Dec 2025 at 15:33, SeongJae Park <sj@kernel.org> wrote:
> > > > >
> > > > > Implement a DAMON core API for reporting page fault events to DAMON. It
> > > > > is a wrapper of damon_report_access().
> > > > >
> > > > > This is a temporal hack. In future versions that will have no RFC tag,
> > > > > only damon_report_access() may be used.
> > > >
> > > > It's a minor, but git am throws an error when applying the [RFC PATCH v3 04/37]
> > > > patch file.
> > >
> > > Interesting. I can do 'git am' this patch without error on mm-new branch. Are
> > > you using something other than mm-new as your baseline?
> > >
> > > > I am testing it by modifying it as follows.
> > > > damon_report_access() is
> > > > called by damon_report_page_fault(), so they depend on each other.
> > > >
> > > > #ifdef CONFIG_MMU
> > > > void damon_report_access(struct damon_access_report *report);
> > > > void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd);
> > > > #else
> > > > static inline void damon_report_access(struct damon_access_report *report)
> > > > {
> > > > }
> > > > static inline void damon_report_page_fault(struct vm_fault *vmf, bool huge_pmd)
> > > > {
> > > > }
> > > > #endif
> > >
> > > Seems this is not for fixing a 'git am' error but build error...? Can you
> > > share what error exactly you are seeing?
> >
> > You have been deploying RFC PATCH v1, v2, and v3 starting from 2025-06-29.
> > I am currently working with the latest version v6.18.1 (as of 2025-12-13).
> >
> > $ head Makefile
> > # SPDX-License-Identifier: GPL-2.0
> > VERSION = 6
> > PATCHLEVEL = 18
> > SUBLEVEL = 1
> > EXTRAVERSION =
> > NAME = Baby Opossum Posse
> >
> > When applying RFC PATCH v1, v2, v3 with the above version, errors occur
> > in several places in 'git am' as follows.
> >
> > -------- [RFC PATCH v1] -------------------------------------------------
> >
> > $ git am '[RFC PATCH 1/6]'
> > Applying: mm/damon/core: introduce damon_report_access()
> >
> > $ git am '[RFC PATCH 2/6]'
> > Applying: mm/damon/core: add eliglble_report() ops callback
> >
> > $ git am '[RFC PATCH 3/6]'
> > Applying: mm/damon/core: check received access reports
> >
> > $ git am '[RFC PATCH 4/6]'
> > Applying: mm/damon/vaddr: impleement eligible_report() callback
> > error: patch failed: mm/damon/vaddr.c:610
> > error: mm/damon/vaddr.c: patch does not apply
> > Patch failed at 0001 mm/damon/vaddr: impleement eligible_report() callback
> > hint: Use 'git am --show-current-patch=diff' to see the failed patch
> > When you have resolved this problem, run "git am --continue".
> > If you prefer to skip this patch, run "git am --skip" instead.
> > To restore the original branch and stop patching, run "git am --abort".
> [...]
>
> Thank you for sharing these! We are working on moving baseline, specifically
> mm-new in most cases. And we keep under-development patches on damon/next
> tree. Please refer to the document [1] for more details.
>
> And a later version of the patch series is for replacing the old version. If
> you have no special reason to apply the old versions of the patches, I'd
> suggest to use only the latest version. And if you have no special reasons to
> use only 6.18.1, I'd recommend to just play with the commits on damon/next
> tree that was used to generate the patch files.
>
> Nonetheless, if you have a strong reason to do work on only 6.18.1, please feel
> free to ask help if needed.
>
> > If I build the kernel with the above status, I get compilation errors
> > as follows.
> >
> > /home/arm64/projects/kernel/linux-stable/mm/damon/sysfs.c:758:25:
> > error: ‘DAMON_FILTER_TYPE_WRITE’ undeclared here (not in a function);
> > did you mean ‘DAMOS_FILTER_TYPE_TARGET’?
> > 758 | .type = DAMON_FILTER_TYPE_WRITE,
> > | ^~~~~~~~~~~~~~~~~~~~~~~
> > | DAMOS_FILTER_TYPE_TARGET
> [...]
>
> Makes sense. Again, I'd recommend using mm-new as your baseline or play with
> the commits on damon/next, but if you need help, please feel free to reach out
> :)
Thank you for your detailed and kind reply.
I am glad to refer to damon/next and mm-new in the document [1] you provided.
I will continue to share the analysis with you.
>
> [1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
> [2]
>
> Thanks,
> SJ
>
> [...]
© 2016 - 2025 Red Hat, Inc.