All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Avoid endless loop for vcpu migration
Date: Tue, 15 Mar 2011 06:50:59 +0100	[thread overview]
Message-ID: <4D7EFE43.7070900@ts.fujitsu.com> (raw)
In-Reply-To: <4D7E3C640200007800036564@vpn.id2.novell.com>

On 03/14/11 16:03, Jan Beulich wrote:
>>>> On 14.03.11 at 15:39, Juergen Gross<juergen.gross@ts.fujitsu.com>  wrote:
>> On multi-thread multi-core systems an endless loop can occur in vcpu_migrate()
>> with credit scheduler. Avoid this loop by changing the interface of pick_cpu
>> to indicate a repeated call in this case.
>
> But you're not changing in any way the loop that doesn't get
> exited - did you perhaps read my original description as the
> pick function itself looping (which - afaict - it doesn't)?

I'm changing the way the pick_cpu function is reacting on multiple calls in
a loop. If I've understood the idle_bias correctly, updating it in each
loop iteration did result in returning another cpu for each call.
By updating idle_bias only once, it should return the same cpu in subsequent
calls. This should exit the loop in vcpu_migrate.

> Further, the change still isn't consistent with idle_bias - the
> updating ought to happen on the last iteration (if you need
> to call the function more than once), not the first one, which
> creates a chicken-and-egg problem for you as you will know
> it's the last one only when it returned.

Is it really so important idle_bias is reflecting the last cpu selected?
I was under the impression it should be okay when this is true in most
cases. With my patch idle_bias might be "wrong" if there is a race with
other cpus forcing a selection of a different cpu in the second iteration
of the loop in vcpu_migrate. Is this really critical? I doubt it.


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

  parent reply	other threads:[~2011-03-15  5:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14 14:39 [PATCH] Avoid endless loop for vcpu migration Juergen Gross
2011-03-14 15:03 ` Jan Beulich
2011-03-14 15:06   ` Tim Deegan
2011-03-15  5:50   ` Juergen Gross [this message]
2011-03-15  7:57     ` Jan Beulich
2011-03-15  8:46       ` Juergen Gross
2011-03-15  8:50         ` Keir Fraser
2011-03-15  8:53           ` Juergen Gross
2011-03-15  9:01         ` Jan Beulich
2011-03-15  9:21           ` Juergen Gross
2011-03-15  9:34             ` Jan Beulich
2011-03-15  9:58             ` Keir Fraser
2011-03-15 10:29               ` Juergen Gross
2011-03-14 15:06 ` Keir Fraser

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=4D7EFE43.7070900@ts.fujitsu.com \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=JBeulich@novell.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.