]> git.baikalelectronics.ru Git - kernel.git/commit
mm/damon/core: finish kdamond as soon as any callback returns an error
authorSeongJae Park <sj@kernel.org>
Tue, 10 May 2022 01:20:54 +0000 (18:20 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 13 May 2022 14:20:08 +0000 (07:20 -0700)
commita6286c5d49aa9b5a2a7cc6ac5f369e9d7bc60ae0
tree9fd0b6ab4c3b9a545a0268c9b9fe18866d63dd84
parent613c0d890bc4e30f0872e2d086d258fa62f1410f
mm/damon/core: finish kdamond as soon as any callback returns an error

When 'after_sampling()' or 'after_aggregation()' DAMON callbacks return an
error, kdamond continues the remaining loop once.  It makes no much sense
to run the remaining part while something wrong already happened.  The
context might be corrupted or having invalid data.  This commit therefore
makes kdamond skips the remaining works and immediately finish in the
cases.

Link: https://lkml.kernel.org/r/20220429160606.127307-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c