From patchwork Fri Dec 10 22:46:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12671275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 683BDC433EF for ; Fri, 10 Dec 2021 22:50:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C8096B0081; Fri, 10 Dec 2021 17:46:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 676836B0082; Fri, 10 Dec 2021 17:46:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53E926B0083; Fri, 10 Dec 2021 17:46:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id 478F26B0081 for ; Fri, 10 Dec 2021 17:46:48 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 065C8181AEF3F for ; Fri, 10 Dec 2021 22:46:38 +0000 (UTC) X-FDA: 78903370476.31.AAE05A0 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf22.hostedemail.com (Postfix) with ESMTP id 7ABA8C0008 for ; Fri, 10 Dec 2021 22:46:37 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 709D9B82A11; Fri, 10 Dec 2021 22:46:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD115C00446; Fri, 10 Dec 2021 22:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1639176395; bh=oETgYmcj1gH/uhD0N3o2roLnBg9WlJ32wefbRp7a+/E=; h=Date:From:To:Subject:In-Reply-To:From; b=SiCerIWL4Z+AJnax3X7SG5AjgkzwTW3JvNv+B35pYVoRtzLYx3jb5kxXGxMYjBXWd bfXTYvA5cE/9565UPfry9qy1ZPWCWOnC5Az1nLAjLdI/jYHSCkCLo2/5RM7LOMMMii IdZFmOlGIRt2Vc/qg1HRn6ASUz0WCI7vd3q6C+MI= Date: Fri, 10 Dec 2021 14:46:34 -0800 From: Andrew Morton 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 Message-ID: <20211210224634.mKra4MjZS%akpm@linux-foundation.org> In-Reply-To: <20211210144539.663efee2c80d8450e6180230@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 7ABA8C0008 X-Stat-Signature: drk541e1bpq8kij6cc6e3faewikwsef1 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=SiCerIWL; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1639176397-310259 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: SeongJae Park 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 Cc: Brendan Higgins Cc: kernel test robot Cc: Shuah Khan Signed-off-by: Andrew Morton --- 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;