From: Andreas Mohr <andi@lisas.de>
To: Tejun Heo <tj@kernel.org>
Cc: Jamie Liu <jamieliu@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: defer to waiting stop_machine
Date: Thu, 29 Aug 2013 22:45:09 +0200 [thread overview]
Message-ID: <20130829204509.GA7995@rhlx01.hs-esslingen.de> (raw)
In-Reply-To: <20130828211312.GB18971@mtj.dyndns.org>
> Isn't the problem that the kworker wouldn't yield to the higher
> priority stopper task while a work item keeps requeueing itself if
> preemption is not enabled? If so, isn't the correct solution just
> adding cond_resched() in the work item processing loop? The analysis
> and solution seem to have gone a bit stray....
While I did not quite follow the very fine and detailed analysis,
I had the same feeling about it.
The previous solution seemed less preferable e.g. for two reasons,
from a modularity/dependency POV:
- required a very specific (code smell?) stop_machine handling dependency
in work queue code (machine stop handling arguably definitely
is a corner case, and thereby supposed to remain just that!)
- new stop_machine_pending() helper is pretty bloated,
and called in a semi-hotpath to boot (since it's using && operators
rather than ||, seems like it would be called pretty much every time)
Preemption checks being expected to be much more general and widespread
thus seems like a much better fit.
Or, to put it another way, could it be that that extra very specific
stop_machine check was simply added since due to missing preemption checks
we were busy-handling there and thus not getting back to standard handling areas
where some *usual*, *hotpath/mainstream* stop_machine checks would have been made?
If so, perhaps there actually are some other cases of wasteful stop_machine check
code sites in the kernel where instead we could simply have a much cheaper
reschedule done, thereby go back to hitting one central (and thus cache-hot)
code site with stop_machine check etc.?
Afraid of having stated the glaringly obvious ;),
Andreas Mohr
next prev parent reply other threads:[~2013-08-29 20:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 21:07 Jamie Liu
2013-08-28 21:13 ` Tejun Heo
2013-08-28 21:33 ` [PATCH] workqueue: cond_resched() after processing each work item Tejun Heo
2013-08-28 23:11 ` Jamie Liu
2013-08-29 20:45 ` Andreas Mohr [this message]
2013-08-29 20:52 ` [PATCH] workqueue: defer to waiting stop_machine Jamie Liu
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=20130829204509.GA7995@rhlx01.hs-esslingen.de \
--to=andi@lisas.de \
--cc=jamieliu@google.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®