lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c0a1e773-7dcf-0e27-95d8-beda673baac7@linux.alibaba.com>
Date:   Thu, 8 Sep 2022 09:43:50 +0800
From:   haoxin <xhao@...ux.alibaba.com>
To:     SeongJae Park <sj@...nel.org>
Cc:     akpm@...ux-foundation.org, damon@...ts.linux.dev,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/damon: Remove duplicate get_monitoring_region()
 definitions


在 2022/9/8 上午4:59, SeongJae Park 写道:
> On Wed, 7 Sep 2022 17:27:12 +0000 SeongJae Park <sj@...nel.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
>
> [...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ