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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43BB5C433EF for ; Thu, 18 Nov 2021 11:51:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CEBD06140A for ; Thu, 18 Nov 2021 11:51:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CEBD06140A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 290666B0072; Thu, 18 Nov 2021 06:51:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 240896B0073; Thu, 18 Nov 2021 06:51:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12EF56B0074; Thu, 18 Nov 2021 06:51:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 04DA66B0072 for ; Thu, 18 Nov 2021 06:51:32 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B9B77183A71BE for ; Thu, 18 Nov 2021 11:51:21 +0000 (UTC) X-FDA: 78821885562.08.EEDAF4D Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf12.hostedemail.com (Postfix) with ESMTP id 6BEB710003C6 for ; Thu, 18 Nov 2021 11:51:21 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id D90F2613D3; Thu, 18 Nov 2021 11:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637236280; bh=6NsGQeJkYE/h4+gY3Tdq71/Dua/S5GFKQb0Dp/iMWXk=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=YVofebohI0ACFzhoYGbU2+QxRe0HA3XT/GFaTFmqOm1Zx4vsNYxUp8SUgRhjQy9YK aIr379BCZKLtAp946n2Ob+ZgeLpbrx8IgaEsWP77wUFVXK/tlcqPEHQmNSXipkhrPZ vp1AOUXsuFmgA3gwRnYfSWwDYDsSGm2SSXcoUaBrK4SmDD+lZ+axn1pcyZmOHXBAOE xxe/jWGfKOoHW61a2OTB5WAn4x9ngMcP99vLs6C400Z/baMz5pzVlJapGdRdxKjuH/ 1keEDfYtCIR5lvI/nxUfLIWCCS6tUJKTYMo2J3kXO/A1CvodPm4sXQYGVtFQ2fjI08 lP/Yc/5EOubBw== From: SeongJae Park To: Xin Hao Cc: sjpark@amazon.de, sj@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V1] mm/damon/schemes: Add the validity judgment of thresholds Date: Thu, 18 Nov 2021 11:51:13 +0000 Message-Id: <20211118115113.20234-1-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <2ebc35fcafe61f9dfbb61cfb5dd3fa2c567c37fa.1637208947.git.xhao@linux.alibaba.com> X-Rspamd-Queue-Id: 6BEB710003C6 X-Stat-Signature: do9upbar8gxkj99j371rz5f7cou75uxe Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YVofeboh; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of sj@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sj@kernel.org X-Rspamd-Server: rspam02 X-HE-Tag: 1637236281-590115 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: Hi Xin, Thank you for this patch. >From next time, please send patches for DAMON to sj@kernel.org instead of sjpark@amazon.de. On Thu, 18 Nov 2021 12:16:02 +0800 Xin Hao wrote: > In dbgfs "schemes" interface, i do some test like this: > # cd /sys/kernel/debug/damon > # echo "2 1 2 1 10 1 3 10 1 1 1 1 1 1 1 1 2 3" > schemes > # cat schemes > # 2 1 2 1 10 1 3 10 1 1 1 1 1 1 1 1 2 3 0 0 > > There have some unreasonable places, i set the valules of these variables > " , , wmarks.mid, wmarks.low>" as "<2, 1>, <2, 1>, <10, 1>, <1, 2, 3>. > > So there add a validity judgment for these threshold values. > > Signed-off-by: Xin Hao > --- > mm/damon/dbgfs.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c > index befb27a29aab..a4c94d563d3d 100644 > --- a/mm/damon/dbgfs.c > +++ b/mm/damon/dbgfs.c > @@ -215,6 +215,17 @@ static struct damos **str_to_schemes(const char *str, ssize_t len, > goto fail; > } > > + if (min_sz > max_sz || min_nr_a > max_nr_a || min_age > max_age) { > + pr_err("mininum > maxinum\n"); I think this error message is not really needed. > + goto fail; > + } > + > + if (wmarks.high < wmarks.mid || wmarks.high < wmarks.low || > + wmarks.mid < wmarks.low) { > + pr_err("wrong wmarks\n"); Ditto. Thanks, SJ > + goto fail; > + } > + > pos += parsed; > scheme = damon_new_scheme(min_sz, max_sz, min_nr_a, max_nr_a, > min_age, max_age, action, "a, &wmarks); > -- > 2.31.0