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 D0C33ECAAD3 for ; Fri, 9 Sep 2022 21:39:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61D0D8D0002; Fri, 9 Sep 2022 17:39:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CCAF8D0001; Fri, 9 Sep 2022 17:39:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46EE28D0002; Fri, 9 Sep 2022 17:39:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 362258D0001 for ; Fri, 9 Sep 2022 17:39:39 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0734340477 for ; Fri, 9 Sep 2022 21:39:39 +0000 (UTC) X-FDA: 79893864078.15.EEC696C Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf20.hostedemail.com (Postfix) with ESMTP id 4D6DA1C00A3 for ; Fri, 9 Sep 2022 21:39:38 +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 5B638CE207B; Fri, 9 Sep 2022 21:39:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17E40C433C1; Fri, 9 Sep 2022 21:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662759573; bh=ex7Bf0A+D0ut+bV7nbUASsm4O5uu3FG1xP29PsRanAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/kOBJE9/qBLBeRdYxTX8is5Xov7qBhcvCrkE3pySFEblHSvpQMa092HH+7wFUQjw f41Y9KYPVP+1RAD0veTboU0ghOTpLsMjIrLjtfy+r++xzwbUWfhv9sVz7LdMqxEW7G nX0Yziat8SBqkxOMeXpts373A3PXW1AqAcAehZNYMUujOe6Khe/FgcEQM9nCyZAnSj 2RVTOmAsDBdvyTdzeBNdoz4sPLDEEBoit0faAZe49NwG9fd6731/BYEM+qo/MRsqzn OpNeRNFbbACh0oTK1xwsYWqL94elfE5W6ce5nZXf1U84K5RyMF7RndLk+6vRIXCcZh M6Bp5A5AzHefQ== From: SeongJae Park To: SeongJae Park Cc: Xin Hao , akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V4] mm/damon: Remove duplicate get_monitoring_region() definitions Date: Fri, 9 Sep 2022 21:39:31 +0000 Message-Id: <20220909213931.136283-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909204520.60047-1-sj@kernel.org> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662759578; a=rsa-sha256; cv=none; b=r1Y9c88YRqMO/jnZAQjoOAP1j+i5qAcZZJVNKyPrFvYIfO7r5VrtY4xQFfXNqiUMv2VRVs 0xA+a7ByUjJGyRR+OfKYNw5VLhAxt9phRehAeH/sDkc7mNhcZyt8BHvkk3BRDrEgcshmAI dxXn2eWZDVObAdVZ5n5ZmaWjR0FRZg4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="j/kOBJE9"; spf=pass (imf20.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662759578; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ksSwBc6bwhUERIr+lZM6P3iPhAkLeF+yQUws83IpaB8=; b=UFr1Aixqrqx+LQ1r9DXvhF494iTFxdryTj1E0zmdfBJTpZ9WCsGoIf36S2jNhz86bsckP9 YvqoPzsGEn/4onEhw13CUYbcCKgPPRuPzZCTjfyVjtu5gkvF2Wr3zPDVPEidKkowAz7JlX yFmawr29RQ0x0LObLfqGOYGpyOJY8Y8= X-Stat-Signature: xhrgdcgz5awbk54d1ni56pu1kt3jqnji X-Rspamd-Queue-Id: 4D6DA1C00A3 X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="j/kOBJE9"; spf=pass (imf20.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-Rspamd-Server: rspam07 X-HE-Tag: 1662759578-322897 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: As my previous comments are almost only cosmetic trivial nits and I don't want to make this unnecessarily delayed long, I made the changes on my own and posted it: https://lore.kernel.org/damon/20220909213606.136221-1-sj@kernel.org/ Xin, if there was anything I missed or there is anything you disagree about my changes, please let me know. Thanks, SJ On Fri, 9 Sep 2022 20:45:20 +0000 SeongJae Park wrote: > On Fri, 9 Sep 2022 10:41:05 +0800 Xin Hao wrote: > > > In lru_sort.c and reclaim.c, they are all defining get_monitoring_region() > > function, there is no need to define it separately. > > > > As 'get_monitoring_region()' is not a 'static' function anymore, we try > > to use a prefix to distinguish with other functions, so there rename it > > to 'damon_find_biggest_system_ram'. > > > > Suggested-by: SeongJae Park > > Signed-off-by: Xin Hao > > --- > > include/linux/damon.h | 11 +++++++++++ > > mm/damon/core.c | 29 +++++++++++++++++++++++++++++ > > mm/damon/lru_sort.c | 37 ++----------------------------------- > > mm/damon/reclaim.c | 37 ++----------------------------------- > > 4 files changed, 44 insertions(+), 70 deletions(-) > > > > diff --git a/include/linux/damon.h b/include/linux/damon.h > > index 7b1f4a488230..6c863b281fb2 100644 > > --- a/include/linux/damon.h > > +++ b/include/linux/damon.h > > @@ -448,6 +448,16 @@ struct damon_ctx { > > struct list_head schemes; > > }; > > > > +/** > > + * struct damon_system_ram_region - System RAM resource address region of [@start, @end). > > I prefer 80 columns, let's break down this line. > https://docs.kernel.org/process/coding-style.html#breaking-long-lines-and-strings > > Also this struct is gonna be used by only damon_find_biggest_system_ram(), so I > think it might make more sense to move this into core.c. > > And, as this is not aimed to directly be used by external API users, I think it > would make more sense to hide from kernel doc (/* instead of /**). > > > + * @start: Start address of the (inclusive). > > of the 'region'? > > > + * @end: End address of the region (exclusive). > > I like the nice explanation: whether its inclusive or exclusive. > > > + */ > > +struct damon_system_ram_region { > > + unsigned long start; > > + unsigned long end; > > +}; > > + > > As this struct is only used by damon_find_biggest_system_ram(), I think it > might make more sense to move this into core.c? > > Below parts all look good. > > Also, this patch seems cannot cleanly applied on top of the latest > mm/mm-unstable branch. Would need rebase. > > > Thanks, > SJ > > [...] >