[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201029130818.GC16774@alley>
Date: Thu, 29 Oct 2020 14:08:18 +0100
From: Petr Mladek <pmladek@...e.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: "Zhang, Qiang" <Qiang.Zhang@...driver.com>,
"tj@...nel.org" <tj@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] kthread_worker: re-set CPU affinities if CPU come
online
On Thu 2020-10-29 09:27:26, Thomas Gleixner wrote:
> The expected semantics of a cpu bound kthread_worker are completely
> unclear and undocumented. This needs to be fixed first and once this is
> established and agreed on then the gaps in the implementation can be
> closed.
I thought about some sane semantic and it goes down to
the following problem:
The per-CPU kthread workers are created by explicitly calling
kthread_create_worker_on_cpu() on each CPU.
The API does _not_ store the information how to start the worker.
As a result, it is not able to start a new one when the CPU
goes online "for the first time". I mean when the CPU was offline
when the API user created the workers.
It means that the API user is responsible for handling CPU hotplug
on its own. We probably should just document it and do nothing else [*]
Alternative solution would be to extend the API and allow to create
kthread_worker on each online CPU. It would require to store
parameters needed to create the kthread only new online CPUs.
Then we might think about some sane semantic for CPU hotplug.
Well, it might be hard to define a sane semantic unless there are
more users of the API. So, I tend to keep it simple and just
document the status quo.
Any ideas?
[*] IMHO, it does not even make sense to manipulate the affinity.
It would just give a false feeling that it is enough.
Best Regards,
Petr
Powered by blists - more mailing lists