Re: [RFC v2] mm/damon: add synchronous validation for commit_inputs

Liew Rui Yan
2026-03-22T06:06:34Z

Hi SeongJae,

I tried implementing the synchronous commit using damon_call() as
suggested, similar to how damon_sysfs_commit_input() works. This
successfully returns errors to userspace immediately instead of failing
silently.

However, I observed a side effect during testing:
Since damon_call() waits for the kdamond thread to process the request,
the latency of writing to 'commit_inputs' depends on the kdamond's
wake-up interval (controlled by damos_watermarks.interval).

In my test with DAMON_LRU_SORT:
- With '.interval=5s', the write latency can be up to ~5 seconds.
- When I temporarily increase '.interval=50s' for testing, the latency
increased proportionally.

I understand this is expected behavior for synchronous communication
with a sleeping kernel thread. However, since 'commit_inputs' is a
control interface rather than a hot path, I wanted to comfirm:

Is this level of latency acceptable for the 'commit_inputs' parameter?
Or should we consider waking up the kdamond thread immediately upon
receiving a damon_call() request to reduce the worst-case latency?

For reference, DAMON_SYSFS seems to have similar latency
charactheristics when using damon_call().

Thank you for you high-level comments and the suggestion! :>

Best regards,
Rui Yan