Re: [RFC PATCH v3 2/4] mm/damon: Generalize ctx_target creation for damon_ops_id and add vaddr support
From: SeongJae Park
Date: Fri Jun 05 2026 - 20:18:43 EST
On Fri, 5 Jun 2026 14:13:01 +0300 Gutierrez Asier <gutierrez.asier@xxxxxxxxxxxxxxxxxxx> wrote:
>
>
> On 6/5/2026 3:50 AM, SeongJae Park wrote:
> > On Thu, 4 Jun 2026 15:03:35 +0000 <gutierrez.asier@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> >> From: Asier Gutierrez <gutierrez.asier@xxxxxxxxxxxxxxxxxxx>
> >>
> >> This patch adds a new function damon_modules_new_vaddr_ctx_target.
> >> Since ctx_target creation for vaddr and paddr is almost
> >> identical, the logic is extracted to a new function,
> >> damon_modules_new_ctx_target, and vaddr and paddr functions
> >> are left just as interfaces.
> >>
> >> This change was suggested earlier1 and it is needed to allow
> >> developers to create DAMON modules that use DAMON_OPS_VADDR targets.
> >>
> >> Signed-off-by: Asier Gutierrez <gutierrez.asier@xxxxxxxxxxxxxxxxxxx>
> >> Suggested-by: SeongJae Park <sj@xxxxxxxxxx>
> >> ---
> >> mm/damon/modules-common.c | 31 +++++++++++++++++++++++++++----
> >> mm/damon/modules-common.h | 3 +++
> >> 2 files changed, 30 insertions(+), 4 deletions(-)
> >
> > This change is for the sample module that will be introduced by the third patch
> > of this series, right?
> >
> > I'd like sample modules to be simple and completely isolated under sample/
> > directory. Is this change really required for the sammple directory? If not,
> > could we please drop this patch?
> So, just create the context manually in the module without a new
> damon_modules_new_vaddr_ctx_target interface?>
Yes.
Thanks,
SJ
[...]