linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: akpm@linux-foundation.org, brendanhiggins@google.com,
	linux-mm@kvack.org, lkp@intel.com, mm-commits@vger.kernel.org,
	shuah@kernel.org, sj@kernel.org, torvalds@linux-foundation.org
Subject: [patch 09/21] mm/damon/core: remove unnecessary error messages
Date: Fri, 10 Dec 2021 14:46:34 -0800	[thread overview]
Message-ID: <20211210224634.mKra4MjZS%akpm@linux-foundation.org> (raw)
In-Reply-To: <20211210144539.663efee2c80d8450e6180230@linux-foundation.org>

From: SeongJae Park <sj@kernel.org>
Subject: 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/20211201150440.1088-4-sj@kernel.org
Fixes: 4bc05954d007 ("mm/damon: implement a debugfs-based user space interface")
Fixes: b9a6ac4e4ede ("mm/damon: adaptively adjust regions")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: kernel test robot <lkp@intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/damon/core.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

--- a/mm/damon/core.c~mm-damon-core-remove-unnecessary-error-messages
+++ a/mm/damon/core.c
@@ -282,7 +282,6 @@ int damon_set_targets(struct damon_ctx *
 	for (i = 0; i < nr_ids; i++) {
 		t = damon_new_target(ids[i]);
 		if (!t) {
-			pr_err("Failed to alloc damon_target\n");
 			/* The caller should do cleanup of the ids itself */
 			damon_for_each_target_safe(t, next, ctx)
 				damon_destroy_target(t);
@@ -312,16 +311,10 @@ int damon_set_attrs(struct damon_ctx *ct
 		    unsigned long aggr_int, unsigned long primitive_upd_int,
 		    unsigned long min_nr_reg, unsigned long max_nr_reg)
 {
-	if (min_nr_reg < 3) {
-		pr_err("min_nr_regions (%lu) must be at least 3\n",
-				min_nr_reg);
+	if (min_nr_reg < 3)
 		return -EINVAL;
-	}
-	if (min_nr_reg > max_nr_reg) {
-		pr_err("invalid nr_regions.  min (%lu) > max (%lu)\n",
-				min_nr_reg, max_nr_reg);
+	if (min_nr_reg > max_nr_reg)
 		return -EINVAL;
-	}
 
 	ctx->sample_interval = sample_int;
 	ctx->aggr_interval = aggr_int;
_


  parent reply	other threads:[~2021-12-10 22:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 22:45 incoming Andrew Morton
2021-12-10 22:46 ` [patch 01/21] Increase default MLOCK_LIMIT to 8 MiB Andrew Morton
2021-12-11  1:08   ` Linus Torvalds
2021-12-10 22:46 ` [patch 02/21] MAINTAINERS: update kdump maintainers Andrew Morton
2021-12-10 22:46 ` [patch 03/21] mailmap: update email address for Guo Ren Andrew Morton
2021-12-10 22:46 ` [patch 04/21] filemap: remove PageHWPoison check from next_uptodate_page() Andrew Morton
2021-12-10 22:46 ` [patch 05/21] timers: implement usleep_idle_range() Andrew Morton
2021-12-10 22:46 ` [patch 06/21] mm/damon/core: fix fake load reports due to uninterruptible sleeps Andrew Morton
2021-12-10 22:46 ` [patch 07/21] mm/damon/core: use better timer mechanisms selection threshold Andrew Morton
2021-12-10 22:46 ` [patch 08/21] mm/damon/dbgfs: remove an unnecessary error message Andrew Morton
2021-12-10 22:46 ` Andrew Morton [this message]
2021-12-10 22:46 ` [patch 10/21] mm/damon/vaddr: remove an unnecessary warning message Andrew Morton
2021-12-10 22:46 ` [patch 11/21] mm/damon/vaddr-test: split a test function having >1024 bytes frame size Andrew Morton
2021-12-10 22:46 ` [patch 12/21] mm/damon/vaddr-test: remove unnecessary variables Andrew Morton
2021-12-10 22:46 ` [patch 13/21] selftests/damon: skip test if DAMON is running Andrew Morton
2021-12-10 22:46 ` [patch 14/21] selftests/damon: test DAMON enabling with empty target_ids case Andrew Morton
2021-12-10 22:46 ` [patch 15/21] selftests/damon: test wrong DAMOS condition ranges input Andrew Morton
2021-12-10 22:46 ` [patch 16/21] selftests/damon: test debugfs file reads/writes with huge count Andrew Morton
2021-12-10 22:46 ` [patch 17/21] selftests/damon: split test cases Andrew Morton
2021-12-10 22:47 ` [patch 18/21] mm/slub: fix endianness bug for alloc/free_traces attributes Andrew Morton
2021-12-10 22:47 ` [patch 19/21] mm/memcg: relocate mod_objcg_mlstate(), get_obj_stock() and put_obj_stock() Andrew Morton
2021-12-10 22:47 ` [patch 20/21] hugetlbfs: fix issue of preallocation of gigantic pages can't work Andrew Morton
2021-12-10 22:47 ` [patch 21/21] mm: bdi: initialize bdi_min_ratio when bdi is unregistered Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211210224634.mKra4MjZS%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=brendanhiggins@google.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=sj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).