Re: [PATCH v1] mm/damon/stat: roll back context on damon_call() failure

From: SeongJae Park

Date: Fri May 29 2026 - 12:50:01 EST


On Fri, 29 May 2026 11:17:01 -0400 최유호 <dbgh9129@xxxxxxxxx> wrote:

> Dear SJ
>
> On Fri, 29 May 2026 at 10:44, SeongJae Park <sj@xxxxxxxxxx> wrote:
>
> > But, having one damon_ctx object in the memory is a real problem? Why?
>
> I agree that keeping one `damon_ctx` is unlikely to be a serious problem.
> My intention was not to address memory pressure but to maintain
> failure-path consistency. If initialization fails after the context is
> created and started, the internal state remains in place despite the
> operation returning an error. The cleanup is then deferred until a
> subsequent retry.
>
> For this reason, I think this is worth fixing as a correctness issue.
> That said, if you feel the current cleanup is sufficient, I can drop
> this patch.

Thank you for clarifying, Yuho. I think the current cleanup is ok, but I
understand it is confusing to read. Apparently that confused you at least, and
that's not ok. What about adding a comment explaining the context?


Thanks,
SJ

[...]