linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: haoxin <xhao@linux.alibaba.com>
To: SeongJae Park <sj@kernel.org>
Cc: akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/damon: Remove duplicate get_monitoring_region() definitions
Date: Thu, 8 Sep 2022 09:43:50 +0800	[thread overview]
Message-ID: <c0a1e773-7dcf-0e27-95d8-beda673baac7@linux.alibaba.com> (raw)
In-Reply-To: <20220907205911.62483-1-sj@kernel.org>


在 2022/9/8 上午4:59, SeongJae Park 写道:
> On Wed, 7 Sep 2022 17:27:12 +0000 SeongJae Park <sj@kernel.org> wrote:
>
> [...]
>>> diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
>>> index b1335de200e7..01938f33038d 100644
>>> --- a/mm/damon/ops-common.c
>>> +++ b/mm/damon/ops-common.c
>>> @@ -172,3 +172,31 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
>>>
>>>   	return hotness;
>>>   }
>>> +
>>> +static inline int walk_system_ram(struct resource *res, void *arg)
>>> +{
>>> +	struct damon_addr_range *a = arg;
>>> +
>>> +	if (a->end - a->start < resource_size(res)) {
>>> +		a->start = res->start;
>>> +		a->end = res->end;
>>> +	}
>>> +	return 0;
>>> +}
>>> +
>>> +/*
>>> + * Find biggest 'System RAM' resource and store its start and end address in
>>> + * @start and @end, respectively.  If no System RAM is found, returns false.
>>> + */
>>> +bool get_monitoring_region(unsigned long *start, unsigned long *end)
>>> +{
>>> +	struct damon_addr_range arg = {};
>>> +
>>> +	walk_system_ram_res(0, ULONG_MAX, &arg, walk_system_ram);
>>> +	if (arg.end <= arg.start)
>>> +		return false;
>>> +
>>> +	*start = arg.start;
>>> +	*end = arg.end;
>>> +	return true;
>>> +}
>> 'ops-common.c' is for code that common in monitoring operations
>> implementations.  I'd prefer to have yet another source file for the DAMON
>> modules including reclaim and lru_sort, say, 'modules-common.c'.
> Or, putting it in damon/core.c might make more sense.
Ok,  i will fix them in my next patch, thanks.
>
>
> Thanks,
> SJ
>
> [...]


  reply	other threads:[~2022-09-08  1:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 11:29 Xin Hao
2022-09-07 17:27 ` SeongJae Park
2022-09-07 20:59   ` SeongJae Park
2022-09-08  1:43     ` haoxin [this message]
2022-09-08  1:55   ` haoxin
2022-09-07 22:07 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0a1e773-7dcf-0e27-95d8-beda673baac7@linux.alibaba.com \
    --to=xhao@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox