[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220907205911.62483-1-sj@kernel.org>
Date: Wed, 7 Sep 2022 20:59:11 +0000
From: SeongJae Park <sj@...nel.org>
To: SeongJae Park <sj@...nel.org>
Cc: akpm@...ux-foundation.org, damon@...ts.linux.dev,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
xhao@...ux.alibaba.com
Subject: Re: [PATCH] mm/damon: Remove duplicate get_monitoring_region() definitions
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.
Thanks,
SJ
[...]
Powered by blists - more mailing lists