mm/damon/sysfs: avoid empty scheme tried regions for large apply interval
authorSeongJae Park <sj@kernel.org>
Thu, 12 Oct 2023 19:22:54 +0000 (19:22 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 18 Oct 2023 21:34:19 +0000 (14:34 -0700)
commit76126332c7606ba25a4ae5db37145fd526985b45
treec684151ef0c3837a45faf3a4190c8537dc9baeb4
parent4d4e41b682990b1dc5bba2bc313800340bf5c2d4
mm/damon/sysfs: avoid empty scheme tried regions for large apply interval

DAMON_SYSFS assumes all schemes will be applied for at least one DAMON
monitoring results snapshot within one aggregation interval, or makes no
sense to wait for it while DAMON is deactivated by the watermarks.  That
for deactivated status still makes sense, but the aggregation interval
based assumption is invalid now because each scheme can has its own apply
interval.  For schemes having larger than the aggregation or watermarks
check interval, DAMOS tried regions update request can be finished without
the update.  Avoid the case by explicitly checking the status of the
schemes tried regions update and watermarks based DAMON deactivation.

Link: https://lkml.kernel.org/r/20231012192256.33556-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/sysfs-common.h
mm/damon/sysfs-schemes.c
mm/damon/sysfs.c