From: Mike Galbraith <efault@gmx.de>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Wen Yang <wen.yang99@zte.com.cn>, Tejun Heo <tj@kernel.org>,
zhong.weidong@zte.com.cn, Jiang Biao <jiang.biao2@zte.com.cn>,
Tan Hu <tan.hu@zte.com.cn>,
kernel test robot <xiaolong.ye@intel.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH V5 5/5] workqueue: introduce a way to set workqueue's scheduler
Date: Mon, 29 Jan 2018 08:27:48 +0100 [thread overview]
Message-ID: <1517210868.7290.96.camel@gmx.de> (raw)
In-Reply-To: <CAJhGHyAw4YYM1kdb==f5a-Ke-iUtFt8QPfg2RDR4gEiD=jkmxw@mail.gmail.com>
On Mon, 2018-01-29 at 14:33 +0800, Lai Jiangshan wrote:
> On Mon, Jan 29, 2018 at 12:41 PM, Mike Galbraith <efault@gmx.de> wrote:
> > On Mon, 2018-01-29 at 12:15 +0800, Lai Jiangshan wrote:
> >> I think adding priority boost to workqueue(flush_work()) is the best
> >> way to fix the problem.
> >
> > I disagree, priority boosting is needlessly invasive, takes control out
> > of user hands. The kernel wanting to run a workqueue does not justify
> > perturbing the user's critical task.
>
> The kworkers doesn't belong to any user, it is really needlessly invasive
> if we give the ability to any user to control the priority of the kworkers.
In a scenario where box is being saturated by RT, every last bit of the
box is likely in the (hopefully capable) hands of a solo box pilot.
With a prio-boosting scheme, which user gets to choose the boost
priority for the global resource?
> If the user's critical task calls flush_work(). the critical task should
> boost one responsible kworker. (the kwoker scheduled for
> the work item, or the first idle kworker or the manager kworker,
> the kwoker for the later two cases is changing, need to migrate
> the boosting to a new kworker when needed)
>
> The boosted work items need to be moved to a prio list in the pool
> too for the boosted kworker to pick it up.
Userspace knows which of its actions are wired up to what kernel
mechanism? New workers are never spawned, stepping on any
prioritization userspace does?
I don't want to argue about it really, I'm just expressing my opinion
on the matter. I have a mechanism in place to let users safely do
whatever they like, have for years, and it's not going anywhere. That
mechanism was born from the needs of users, not mine. First came a
user with a long stable product that suddenly ceased to function due to
workqueues learning to spawn new threads, then came a few cases where
users were absolutely convinced that they really really did need to be
able to safely saturate. I could have said tough titty, adapt your
product to use a dedicated kthread to the one, and no you just think
you need to do that to the others, but I'm not (quite) that arrogant,
gave them the control they wanted instead.
-Mike
prev parent reply other threads:[~2018-01-29 7:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-27 5:15 [RFC PATCH V5 1/5] workqueue: rename system workqueues Wen Yang
2018-01-27 5:15 ` [RFC PATCH V5 2/5] workqueue: expose attrs for " Wen Yang
2018-01-27 5:15 ` [RFC PATCH V5 3/5] workqueue: rename unbound_attrs to attrs Wen Yang
2018-01-27 5:15 ` [RFC PATCH V5 4/5] workqueue: convert ->nice to ->sched_attr Wen Yang
2018-01-27 5:15 ` [RFC PATCH V5 5/5] workqueue: introduce a way to set workqueue's scheduler Wen Yang
2018-01-27 9:31 ` Mike Galbraith
2018-01-27 12:37 ` Mike Galbraith
2018-01-29 4:15 ` Lai Jiangshan
2018-01-29 4:41 ` Mike Galbraith
2018-01-29 6:33 ` Lai Jiangshan
2018-01-29 7:27 ` Mike Galbraith [this message]
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=1517210868.7290.96.camel@gmx.de \
--to=efault@gmx.de \
--cc=jiang.biao2@zte.com.cn \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tan.hu@zte.com.cn \
--cc=tj@kernel.org \
--cc=wen.yang99@zte.com.cn \
--cc=xiaolong.ye@intel.com \
--cc=zhong.weidong@zte.com.cn \
/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