Skip to content

Commit 1afaf5c

Browse files
sjp38torvalds
authored andcommitted
mm/damon/core: remove unnecessary error messages
DAMON core prints error messages when damon_target object creation is failed or wrong monitoring attributes are given. Because appropriate error code is returned for each case, the messages are not essential. Also, because the code path can be triggered with user-specified input, this could result in kernel log mistakenly being messy. To avoid the case, this commit removes the messages. Link: https://lkml.kernel.org/r/[email protected] Fixes: 4bc0595 ("mm/damon: implement a debugfs-based user space interface") Fixes: b9a6ac4 ("mm/damon: adaptively adjust regions") Signed-off-by: SeongJae Park <[email protected]> Cc: Brendan Higgins <[email protected]> Cc: kernel test robot <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0bceffa commit 1afaf5c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

mm/damon/core.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ int damon_set_targets(struct damon_ctx *ctx,
282282
for (i = 0; i < nr_ids; i++) {
283283
t = damon_new_target(ids[i]);
284284
if (!t) {
285-
pr_err("Failed to alloc damon_target\n");
286285
/* The caller should do cleanup of the ids itself */
287286
damon_for_each_target_safe(t, next, ctx)
288287
damon_destroy_target(t);
@@ -312,16 +311,10 @@ int damon_set_attrs(struct damon_ctx *ctx, unsigned long sample_int,
312311
unsigned long aggr_int, unsigned long primitive_upd_int,
313312
unsigned long min_nr_reg, unsigned long max_nr_reg)
314313
{
315-
if (min_nr_reg < 3) {
316-
pr_err("min_nr_regions (%lu) must be at least 3\n",
317-
min_nr_reg);
314+
if (min_nr_reg < 3)
318315
return -EINVAL;
319-
}
320-
if (min_nr_reg > max_nr_reg) {
321-
pr_err("invalid nr_regions. min (%lu) > max (%lu)\n",
322-
min_nr_reg, max_nr_reg);
316+
if (min_nr_reg > max_nr_reg)
323317
return -EINVAL;
324-
}
325318

326319
ctx->sample_interval = sample_int;
327320
ctx->aggr_interval = aggr_int;

0 commit comments

Comments
 (0)