From: Thomas Gleixner <tglx@linutronix.de>
To: "Zhang\, Qiang" <Qiang.Zhang@windriver.com>,
"pmladek\@suse.com" <pmladek@suse.com>,
"tj\@kernel.org" <tj@kernel.org>
Cc: "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 09:27:26 +0100 [thread overview]
Message-ID: <874kmdfndd.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <BYAPR11MB2632B18DF7C02B68E758932BFF140@BYAPR11MB2632.namprd11.prod.outlook.com>
On Thu, Oct 29 2020 at 03:14, Qiang Zhang wrote:
> Really, this patch is not considered that work may be put into the
> queue after the bound CPU is offline. in addition, when the bound CPU
> goes online again, before restoring the worker's CPU affinity, work
> may be put into the queue.
And how is that supposed to be correct?
> Although int this (powerclamp) way,that's not a problem, that it is
> solved by destroying and creating tasks when the CPU hotplug, in
> addition, when CPU going down , this need call 'cancel_work_sync' func
> in offline callback, this may be blocked long time. these operation is
> expensive.
It does not matter whether it's expensive or not. It's correct and
that's what matters most.
> this patch only just to recover the worker task's affinity when CPU go
> to online again that create by "kthread_create_worker_on_cpu" func ,
> likely per-CPU worker method when CPU hotplug in "workqueue" and
> "io-wq".
I know what this patch just does, but that makes it not any more
correct. It creates a semanticaly ill defined illusion of correctness.
We are not "fixing" a problem by making it work for your particular and
even not explained use case.
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.
Thanks,
tglx
next prev parent reply other threads:[~2020-10-29 8:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 7:30 [PATCH v2] kthread_worker: re-set CPU affinities if CPU come online 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 [this message]
2020-10-29 13:08 ` Petr Mladek
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=874kmdfndd.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=Qiang.Zhang@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pmladek@suse.com \
--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;
as well as URLs for NNTP newsgroup(s).