Skip to content

Commit bb1b592

Browse files
sjp38akpm00
authored andcommitted
mm/damon/core: handle damon_call_control as normal under kdmond deactivation
DAMON sysfs interface internally uses damon_call() to update DAMON parameters as users requested, online. However, DAMON core cancels any damon_call() requests when it is deactivated by DAMOS watermarks. As a result, users cannot change DAMON parameters online while DAMON is deactivated. Note that users can turn DAMON off and on with different watermarks to work around. Since deactivated DAMON is nearly same to stopped DAMON, the work around should have no big problem. Anyway, a bug is a bug. There is no real good reason to cancel the damon_call() request under DAMOS deactivation. Fix it by simply handling the request as normal, rather than cancelling under the situation. Link: https://lkml.kernel.org/r/[email protected] Fixes: 42b7491 ("mm/damon/core: introduce damon_call()") Signed-off-by: SeongJae Park <[email protected]> Cc: <[email protected]> [6.14+] Signed-off-by: Andrew Morton <[email protected]>
1 parent ddd0574 commit bb1b592

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mm/damon/core.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,9 +2355,8 @@ static void kdamond_usleep(unsigned long usecs)
23552355
*
23562356
* If there is a &struct damon_call_control request that registered via
23572357
* &damon_call() on @ctx, do or cancel the invocation of the function depending
2358-
* on @cancel. @cancel is set when the kdamond is deactivated by DAMOS
2359-
* watermarks, or the kdamond is already out of the main loop and therefore
2360-
* will be terminated.
2358+
* on @cancel. @cancel is set when the kdamond is already out of the main loop
2359+
* and therefore will be terminated.
23612360
*/
23622361
static void kdamond_call(struct damon_ctx *ctx, bool cancel)
23632362
{
@@ -2405,7 +2404,7 @@ static int kdamond_wait_activation(struct damon_ctx *ctx)
24052404
if (ctx->callback.after_wmarks_check &&
24062405
ctx->callback.after_wmarks_check(ctx))
24072406
break;
2408-
kdamond_call(ctx, true);
2407+
kdamond_call(ctx, false);
24092408
damos_walk_cancel(ctx);
24102409
}
24112410
return -EBUSY;

0 commit comments

Comments
 (0)