Re: [PATCH 02/10] mm/damon/core: add damon_new_region() debug_sanity check
From: SeongJae Park
Date: Mon Jun 08 2026 - 10:51:21 EST
On Mon, 8 Jun 2026 19:07:28 +0800 Zenghui Yu <yuzenghui@xxxxxxxxxx> wrote:
> On 2026/6/8 0:53, SeongJae Park wrote:
> > Hello Zenghui,
> >
> > On Sun, 7 Jun 2026 23:24:27 +0800 Zenghui Yu <zenghui.yu@xxxxxxxxx> wrote:
[...]
> > > --- a/samples/damon/mtier.c
> > > +++ b/samples/damon/mtier.c
> > > @@ -118,6 +118,9 @@ static struct damon_ctx *damon_sample_mtier_build_ctx(bool promote)
> > > } else {
> > > addr.start = promote ? node1_start_addr : node0_start_addr;
> > > addr.end = promote ? node1_end_addr : node0_end_addr;
> > > +
> > > + if (addr.start >= addr.end)
> > > + goto free_out;
> > > }
> > >
> > > region = damon_new_region(addr.start, addr.end);
> >
> > Because mtier is just a sample module, and this doesn't cause a catastrophic
> > situation like system crash, I think this is very urgent.
>
> I assume you meant "this is not very urgent" ;) .
Ah, you are right :)
>
> > But, given the
> > simplicity of the change, this looks good to me. If you'd like to send a
> > patch, please feel free to do.
>
> Sure, I will send it out shortly.
Cool, I got it [1].
[1] https://lore.kernel.org/20260608111534.264-1-yuzenghui@xxxxxxxxxx
Thanks,
SJ
[...]