Re: [RFC PATCH] mm/damon: reset thread status parameters upon kdamond termination

SeongJae Park
2026-04-03T14:06:13Z

On Fri, 3 Apr 2026 12:34:48 +0800 Liew Rui Yan <aethernet65535@gmail.com> wrote:

> On Thu, 2 Apr 2026 06:54:39 -0700 SeongJae Park <sj@kernel.org> wrote:
>
> > On Thu, 2 Apr 2026 13:34:58 +0800 Liew Rui Yan <aethernet65535@gmail.com> wrote:
[...]
> > > - When the user writes 'Y' to 'enabled', if enabled is already 'Y' but
> > > kdamond is terminated, we treat this as a restart request.
> >
> > This sounds bit odd to me. User shows enabled=Y and kdamond_pid!=-1. Why they
> > would write 'Y' again? Yes, they would notice kdamond is terminated in real,
> > using 'ps' like tool. But even in the case, I'd imagine users would write N to
> > enabled first, and then write Y to enabled. In other words, this could improve
> > the user experience, but seems not really necessary to me, at least as a
> > hotfix. What do you think?
>
> I see your point. I wasn't thinking of this as a hotfix at first, but
> you're right - for a bug like this, simple and backportable is the way
> to go.
>
> So I will drop the "Write Y to Restart" logic in the next version. I
> will only fix the state in the 'N' path and after commit failures.

Thank you for accepting my suggestion.

>
> >
> > >
> > > This way, even if kdamond terminates unexpectedly, the next user
> > > interaction will recover the state automatically.
> > >
> > > Does this approach sound reasonable?
> >
> > Yes, the plan for the next version sounds good to me.
>
> Great! Thank you for helping me scope this properly! :>

You're welcome :)

Thanks,
SJ …