[PATCH 08/11] samples/damon/mtier: stop all contexts with single damon_stop() call

From: SJ Park

Date: Mon Jul 06 2026 - 12:20:05 EST


damon_stop() was theoretically able to return failure while keeping the
second context for mtier running. mtier stops its contexts one by one
with two damon_stop() call for the reason. damon_stop() is refactored
to always successfully stop all requested DAMON contexts. The two calls
are unnecessary. Use only single damon_stop() call for all contexts.

Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
samples/damon/mtier.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c
index 90881e8bd441f..ac9c24b92ead8 100644
--- a/samples/damon/mtier.c
+++ b/samples/damon/mtier.c
@@ -200,8 +200,7 @@ static int damon_sample_mtier_start(void)

static void damon_sample_mtier_stop(void)
{
- damon_stop(ctxs, 1);
- damon_stop(&ctxs[1], 1);
+ damon_stop(ctxs, 2);
damon_destroy_ctx(ctxs[0]);
damon_destroy_ctx(ctxs[1]);
}
--
2.47.3