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 DE836ECAAA1 for ; Sat, 10 Sep 2022 01:12:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 339806B0071; Fri, 9 Sep 2022 21:12:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E8036B0072; Fri, 9 Sep 2022 21:12:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D70B8D0001; Fri, 9 Sep 2022 21:12:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0BE196B0071 for ; Fri, 9 Sep 2022 21:12:07 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id DA7FB1404A8 for ; Sat, 10 Sep 2022 01:12:06 +0000 (UTC) X-FDA: 79894399452.21.AB1D631 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by imf25.hostedemail.com (Postfix) with ESMTP id BC126A00B0 for ; Sat, 10 Sep 2022 01:12:04 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VPDKArq_1662772319; Received: from 192.168.1.6(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0VPDKArq_1662772319) by smtp.aliyun-inc.com; Sat, 10 Sep 2022 09:12:00 +0800 Message-ID: <56ecdabb-438a-6efe-6d1d-8d4eceda3652@linux.alibaba.com> Date: Sat, 10 Sep 2022 09:11:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH V4] mm/damon: Remove duplicate get_monitoring_region() definitions To: SeongJae Park Cc: akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220909213931.136283-1-sj@kernel.org> From: haoxin In-Reply-To: <20220909213931.136283-1-sj@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662772326; a=rsa-sha256; cv=none; b=tRbKRgdC8imCJZcEZvmaZW5CG9SVM+hJTqzsUBZ+T+XB+oizr0Z90o2gs2m0EqIlMvIpB1 3vCXjX3knCDWtskuIezgv1n3cJ19EkpQYa/f+8Aeo9RQrC9ejHwGbGtHouLTW2L/nIqeMg 1mBuj5Dmkzp/DvnZY+yLiHDdL3ZWZ78= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf25.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.45 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662772326; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zoIOjdXLmVzauGsAVE4fnoDbWAuDbVfbdpLBLG2FaWM=; b=BTvLZj7f0Xo8M+L272yQE4q/cEQyNgxnjcPxOVGb31qTFYhXch3KuFsVT2GR4b7VflqMJp H+zKKMMt0UHyqloPXvXq+5uGqeFdJz6Fj7rND52hDFP0Nrn+I0TiaHra6WxOkHgubqK7xE RGLqi0Y//icY6znXE6HrFytoFmSbB0g= Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf25.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.45 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Stat-Signature: 6rkei445396qdhrt47hmpiufedgifjwc X-Rspamd-Queue-Id: BC126A00B0 X-HE-Tag: 1662772324-379033 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: 在 2022/9/10 上午5:39, SeongJae Park 写道: > 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/ Thanks a lot for your modification,your suggestion is reasonable too. > > 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 >> >> [...] >>