From patchwork Wed Dec 1 15:04:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12650149 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 D6862C433F5 for ; Wed, 1 Dec 2021 15:09:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9507F6B0080; Wed, 1 Dec 2021 10:07:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D60A6B0081; Wed, 1 Dec 2021 10:07:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79E026B0082; Wed, 1 Dec 2021 10:07:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id 64F496B0080 for ; Wed, 1 Dec 2021 10:07:16 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2CED28249980 for ; Wed, 1 Dec 2021 15:07:06 +0000 (UTC) X-FDA: 78869553252.27.DD1A710 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf20.hostedemail.com (Postfix) with ESMTP id 79A50D000C98 for ; Wed, 1 Dec 2021 15:05:06 +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 AECA8B81DE4; Wed, 1 Dec 2021 15:05:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4256C56748; Wed, 1 Dec 2021 15:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638371101; bh=sQWMtyONHmc3W+Sgg4QUiiH5In2nUhULeFdo0mShTis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KuLTSc5tK1l9ku/4X3hIvrCsTFR605bwQnRHywxxvsKhtGsDKcvlVLeZ7h1knqpU6 8Nhz9aLb/+kVTo3gsf+4VFFoLg92ZbukwubUK7KzeRUY1EMtkB/dMoeeU35+Pbxkuf XTFRW/rvAGHTQZnYwDgk0nDKlq5k5FUfuBESQBX0G3jf7GRUgOoHOHtRmf23av+jFA QEmcYoKlbqy5T6trsm4ct6oNtZ6rpLCkL8blYDltnW6Bhg+ibHCX8HLnaMyPoBMhwh tZ06D2moRfmYxvo1CykV4UpTin2lNzjCq3n2zhbEP29Q35J7tdrv3Xzebet3//b1vR oVrgNFatqUNVQ== From: SeongJae Park To: akpm@linux-foundation.org Cc: shuah@kernel.org, brendanhiggins@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 03/11] mm/damon/core: Remove unnecessary error messages Date: Wed, 1 Dec 2021 15:04:32 +0000 Message-Id: <20211201150440.1088-4-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211201150440.1088-1-sj@kernel.org> References: <20211201150440.1088-1-sj@kernel.org> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 79A50D000C98 X-Stat-Signature: a6r67zkterwuhw7e4jzt3599wgpfyfb7 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KuLTSc5t; spf=pass (imf20.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1638371106-126173 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: 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. Fixes: 4bc05954d007 ("mm/damon: implement a debugfs-based user space interface") Fixes: b9a6ac4e4ede ("mm/damon: adaptively adjust regions") Signed-off-by: SeongJae Park --- mm/damon/core.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index ccc62479549a..04b8df7fd9e9 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -282,7 +282,6 @@ int damon_set_targets(struct damon_ctx *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 *ctx, unsigned long sample_int, 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;