From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
Zachary Amsden <zach@vmware.com>
Subject: Re: [PATCH] stopmachine: add stopmachine_timeout
Date: Mon, 14 Jul 2008 23:20:26 +0200 [thread overview]
Message-ID: <20080714212026.GA6705@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <487BA152.1070102@goop.org>
On Mon, Jul 14, 2008 at 11:56:18AM -0700, Jeremy Fitzhardinge wrote:
> Rusty Russell wrote:
> > On Monday 14 July 2008 21:51:25 Christian Borntraeger wrote:
> >> Am Montag, 14. Juli 2008 schrieb Hidetoshi Seto:
> >>
> >>> + /* Wait all others come to life */
> >>> + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) {
> >>> + if (time_is_before_jiffies(limit))
> >>> + goto timeout;
> >>> + cpu_relax();
> >>> + }
> >>> +
> >>>
> >> Hmm. I think this could become interesting on virtual machines. The
> >> hypervisor might be to busy to schedule a specific cpu at certain load
> >> scenarios. This would cause a failure even if the cpu is not really locked
> >> up. We had similar problems with the soft lockup daemon on s390.
> > 5 seconds is a fairly long time. If all else fails we could have a config
> > option to simply disable this code.
Hmm.. probably a stupid question: but what could happen that a real cpu
(not virtual) becomes unresponsive so that it won't schedule a MAX_RT_PRIO-1
prioritized task for 5 seconds?
> >> It would be good to not-use wall-clock time, but really used cpu time
> >> instead. Unfortunately I have no idea, if that is possible in a generic
> >> way. Heiko, any ideas?
> >
> > Ah, cpu time comes up again. Perhaps we should actually dig that up again;
> > Zach and Jeremy CC'd.
>
> Hm, yeah. But in this case, it's tricky. CPU time is an inherently
> per-cpu quantity. If cpu A is waiting for cpu B, and wants to do the
> timeout in cpu-seconds, then it has to be in *B*s cpu-seconds (and if A
> is waiting on B,C,D,E,F... it needs to measure separate timeouts with
> separate timebases for each other CPU). It also means that if B is
> unresponsive but also not consuming any time (blocked in IO,
> administratively paused, etc), then the timeout will never trigger.
>
> So I think monotonic wallclock time actually makes the most sense here.
This is asking for trouble... a config option to disable this would be
nice. But as I don't know which problem this patch originally addresses
it might be that this is needed anyway. So lets see why we need it first.
> The other issue is whether cpu_relax() is the right thing to put in the
> busywait. We don't hook it in pvops, so it's just an x86 "pause"
> instruction, so from the hypervisor's perspective it just looks like a
> spinning CPU. We could either hook cpu_relax() into a hypervisor yield,
> or come up with a heavier-weight cpu_snooze() (cpu_relax() is often used
> in loops which are expected to have a short duration, where doing a
> hypercall+yield would be overkill).
cpu_relax() translates to a hypervisor yield on s390. Probably makes sense
if other architectures would do the same.
next prev parent reply other threads:[~2008-07-14 21:21 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-14 7:52 Hidetoshi Seto
2008-07-14 8:19 ` Hidetoshi Seto
2008-07-14 10:43 ` Rusty Russell
2008-07-15 1:11 ` Hidetoshi Seto
2008-07-15 7:50 ` Rusty Russell
2008-07-16 4:05 ` Hidetoshi Seto
2008-07-20 9:45 ` Rusty Russell
2008-07-22 3:28 ` [PATCH] stopmachine: allow force progress on timeout Hidetoshi Seto
2008-07-14 11:51 ` [PATCH] stopmachine: add stopmachine_timeout Christian Borntraeger
2008-07-14 12:34 ` Rusty Russell
2008-07-14 18:56 ` Jeremy Fitzhardinge
2008-07-14 21:20 ` Heiko Carstens [this message]
2008-07-15 1:14 ` Rusty Russell
2008-07-15 2:24 ` Hidetoshi Seto
2008-07-15 2:37 ` Max Krasnyansky
2008-07-15 2:24 ` Max Krasnyansky
2008-07-15 6:09 ` Heiko Carstens
2008-07-15 8:09 ` Rusty Russell
2008-07-15 8:39 ` Heiko Carstens
2008-07-15 8:51 ` Max Krasnyansky
2008-07-16 9:15 ` Christian Borntraeger
2008-07-16 4:27 ` [PATCH] stopmachine: add stopmachine_timeout v2 Hidetoshi Seto
2008-07-16 6:23 ` Max Krasnyansky
2008-07-16 6:35 ` Hidetoshi Seto
2008-07-16 6:51 ` [PATCH] stopmachine: add stopmachine_timeout v3 Hidetoshi Seto
2008-07-16 7:33 ` Peter Zijlstra
2008-07-16 8:12 ` Hidetoshi Seto
2008-07-16 10:11 ` [PATCH] stopmachine: add stopmachine_timeout v2 Jeremy Fitzhardinge
2008-07-17 3:40 ` Hidetoshi Seto
2008-07-17 5:37 ` Jeremy Fitzhardinge
2008-07-18 4:18 ` Rusty Russell
2008-07-17 6:12 ` [PATCH] stopmachine: add stopmachine_timeout v4 Hidetoshi Seto
2008-07-17 7:09 ` Max Krasnyansky
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=20080714212026.GA6705@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=seto.hidetoshi@jp.fujitsu.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=zach@vmware.com \
/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
Powered by JetHome