Re: [PATCH 2/2] mm/damon: skip deactivated schemes in watermark checks and add fallback sleep
SJ Park <[email protected]>
| Newsgroups | dev.linux.lists.damon,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
Hello Liew, On Fri, 7 Aug 2026 17:35:26 +0800 Liew Rui Yan <[email protected]> wrote: > According to DAMOS design documentation, a scheme is deactivated when > nr_snapshots reaches max_nr_snapshots. However, the previous > kdamond_wait_activation() still checked the schemes which nr_snapshots > reached max_nr_snapshots. > > This caused an issue - when all schemes were deactivated due to > max_nr_snapshots, but their watermarks were still satisfied, > damos_wmark_wait_us() would return 0, causing kdamond_wait_activation() > to return 0 (activated). The main loop would then continue without > sleeping, leading to unnecessary overhead since all schemes would be > skipped in damon_do_apply_schemes(). This is an intended implementation. When all schemes are deactivated by watermarks, DAMON stops monitoring. It was implemented in the way because we didn't want DAMON consumes system resource in the case. But, later it turned out DAMON's resource consumption is really negligible. Rather, it is turned out that it makes DAMON runs with stale history when it is activated again. Particularly, regions have 'age' and their start/end addresses that was emerged before the deactivation. Those are meaningless and could even cause wrong DAMOS decisions. We don't want that anymore. For a case the user really want DAMON completely stops, we introduced 'pause'. For max_nr_snapshot-based deactivation, we don't intend to completely stop DAMON. Maybe the documentation can be updated to further clarify this. Thanks, SJ [...]