From: Petr Mladek <pmladek@suse.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Zhang, Qiang" <Qiang.Zhang@windriver.com>,
"tj@kernel.org" <tj@kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] kthread_worker: re-set CPU affinities if CPU come online
Date: Thu, 29 Oct 2020 14:08:18 +0100 [thread overview]
Message-ID: <20201029130818.GC16774@alley> (raw)
In-Reply-To: <874kmdfndd.fsf@nanos.tec.linutronix.de>
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
next prev parent reply other threads:[~2020-10-29 13:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 7:30 qiang.zhang
2020-10-28 8:30 ` Thomas Gleixner
2020-10-28 8:45 ` 回复: " Zhang, Qiang
2020-10-28 9:23 ` Thomas Gleixner
2020-10-29 3:14 ` 回复: " Zhang, Qiang
2020-10-29 8:27 ` Thomas Gleixner
2020-10-29 13:08 ` Petr Mladek [this message]
2020-10-29 15:01 ` Thomas Gleixner
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=20201029130818.GC16774@alley \
--to=pmladek@suse.com \
--cc=Qiang.Zhang@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tglx@linutronix.de \
--cc=tj@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