From mboxrd@z Thu Jan 1 00:00:00 1970 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 43BBFC433F5 for ; Wed, 8 Dec 2021 12:50:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA1D56B0071; Wed, 8 Dec 2021 07:49:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A51C26B0073; Wed, 8 Dec 2021 07:49:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9194C6B0074; Wed, 8 Dec 2021 07:49:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay030.a.hostedemail.com [64.99.140.30]) by kanga.kvack.org (Postfix) with ESMTP id 842336B0071 for ; Wed, 8 Dec 2021 07:49:59 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 48C9D20D1B for ; Wed, 8 Dec 2021 12:49:49 +0000 (UTC) X-FDA: 78894608898.24.98BC08D Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf26.hostedemail.com (Postfix) with ESMTP id 5CA0B20019C8 for ; Wed, 8 Dec 2021 12:49:48 +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 sin.source.kernel.org (Postfix) with ESMTPS id 06984CE2164; Wed, 8 Dec 2021 12:49:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7392C00446; Wed, 8 Dec 2021 12:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638967782; bh=cdtsQhmjW17y2geFF7A/kvKYIuPdnZxMxM9EFG7yPek=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=GKefE0FJlSp09ATc7OSSkIA/FF/j8dXFkQD7p77lR93lXODMt/xcedN/CN5rwBSo7 KrFxFxmPv41A2oLhmQwIbCyyQWo2kz+pk7wMzQKcEyXPt6M035oKWw/Tc5TOxx3tqu gD7icFTsIa8NhzkcryC8/CPzl3SzMXs9QdrzZbjibuQkJwnPD3rNMLsUr7VSAN3feX cCCpXdrw0Iuu2+fXw296pcgRQywppatJX0N7a3U40yt2wlSjEMZiZ2y0SqbO0X7/DO YTanpn1vlhMi7LrePtB5J7TPHbd/K4TnvZij+bCdLJoEwU2gtwUqNBlf02K7wI92d4 veagj6Hnd25Hw== From: SeongJae Park To: Xin Hao Cc: SeongJae Park , akpm@linux-foundation.org, shuah@kernel.org, brendanhiggins@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/11] mm/damon/dbgfs: Remove an unnecessary error message Date: Wed, 8 Dec 2021 12:49:38 +0000 Message-Id: <20211208124938.4035-1-sj@kernel.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 In-Reply-To: <71535f68-4086-45df-2d4b-36a1802c9475@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5CA0B20019C8 X-Stat-Signature: kzy9c1dwd7z5zj857oi1pbowetmaaehb Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GKefE0FJ; spf=pass (imf26.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1638967788-543061 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: On Wed, 8 Dec 2021 14:29:40 +0800 Xin Hao wrote: Hi Xin, > > Hi park: > > On 12/1/21 11:04 PM, SeongJae Park wrote: > > When wrong scheme action is requested via the debugfs interface, DAMON > > prints an error message. Because the function returns error code, this > > is not really needed. Because the code path is triggered by the user > > specified input, this can result in kernel log mistakenly being messy. > > Completely correct, but there will also be a problem that users can’t > quickly locate where the problem is, > > Especially too many parameters need to be written into the interface. > > I think it is necessary to add some debugging methods to help users find > the error without polluting the kernel log. > > And i have an idea, like this: > > in dbgfs, add a last_cmd_stat interface. > > # echo "1 2 1 2 1 2 1 2 1 2 100 ..." > schemes > > # cat last_cmd_stat > > # wrong action 100 > > In this way, on the one hand, it will not pollute the kernel log, on the > other hand, it will help users find the cause of the operation > interface error. > > Park, how do you think of about this idea, if ok, i will send a patch. Thank you always for your great suggestions and efforts! BTW, I prefer to be called with my first name ;) I want DAMON kernel code to be as simple and small as possible, while putting fancy but complicated features for user conveniences in user space tools like DAMO[1]. In other words, I hope the DAMON debugfs interface to be used as an interface for such user space tools, not an interface for human hands. IMHO, implementing the feature you proposed in the kernel could make the code slightly bigger, while it can easily implemented in user space. I therefore think the feature would be better to be implemented in user space. If you could send a pull request of the feature for DAMO, it would be so great. [1] https://github.com/awslabs/damo Thanks, SJ > > > To avoid the case, this commit removes the message > > > > Fixes: af122dd8f3c0 ("mm/damon/dbgfs: support DAMON-based Operation Schemes") > > Signed-off-by: SeongJae Park > > --- > > mm/damon/dbgfs.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c > > index 4bf4204444ab..5b628990ae6e 100644 > > --- a/mm/damon/dbgfs.c > > +++ b/mm/damon/dbgfs.c > > @@ -210,10 +210,8 @@ static struct damos **str_to_schemes(const char *str, ssize_t len, > > &wmarks.low, &parsed); > > if (ret != 18) > > break; > > - if (!damos_action_valid(action)) { > > - pr_err("wrong action %d\n", action); > > + if (!damos_action_valid(action)) > > goto fail; > > - } > > > > if (min_sz > max_sz || min_nr_a > max_nr_a || min_age > max_age) > > goto fail; > > -- > Best Regards! > Xin Hao >