[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200313201649.26646-1-sj38.park@gmail.com>
Date: Fri, 13 Mar 2020 21:16:49 +0100
From: SeongJae Park <sj38.park@...il.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: SeongJae Park <sjpark@...zon.com>, akpm@...ux-foundation.org,
SeongJae Park <sjpark@...zon.de>, aarcange@...hat.com,
yang.shi@...ux.alibaba.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, amit@...nel.org,
brendan.d.gregg@...il.com, brendanhiggins@...gle.com, cai@....pw,
colin.king@...onical.com, corbet@....net, dwmw@...zon.com,
jolsa@...hat.com, kirill@...temov.name, mark.rutland@....com,
mgorman@...e.de, minchan@...nel.org, mingo@...hat.com,
namhyung@...nel.org, peterz@...radead.org, rdunlap@...radead.org,
rientjes@...gle.com, rostedt@...dmis.org, shuah@...nel.org,
sj38.park@...il.com, vbabka@...e.cz, vdavydov.dev@...il.com,
linux-mm@...ck.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: Re: [PATCH v6 02/14] mm/damon: Implement region based sampling
On Fri, 13 Mar 2020 17:29:54 +0000 Jonathan Cameron <Jonathan.Cameron@...wei.com> wrote:
> On Mon, 24 Feb 2020 13:30:35 +0100
> SeongJae Park <sjpark@...zon.com> wrote:
>
> > From: SeongJae Park <sjpark@...zon.de>
> >
> > This commit implements DAMON's basic access check and region based
> > sampling mechanisms. This change would seems make no sense, mainly
> > because it is only a part of the DAMON's logics. Following two commits
> > will make more sense.
> >
[...]
>
> Came across a minor issue inline. kthread_run calls kthread_create.
> That gives a potential sleep while atomic issue given the spin lock.
>
> Can probably be fixed by preallocating the thread then starting it later.
>
> Jonathan
[...]
> > +/*
> > + * Start or stop the kdamond
> > + *
> > + * Returns 0 if success, negative error code otherwise.
> > + */
> > +static int damon_turn_kdamond(struct damon_ctx *ctx, bool on)
> > +{
> > + spin_lock(&ctx->kdamond_lock);
> > + ctx->kdamond_stop = !on;
> > + if (!ctx->kdamond && on) {
> > + ctx->kdamond = kthread_run(kdamond_fn, ctx, "kdamond");
>
> Can't do this under a spin lock.
Good catch! And, agree to your suggestion. I will fix this in that way!
Thanks,
SeongJae Park
Powered by blists - more mailing lists