xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: "Wei, Gang" <gang.wei@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: dump runq with debug key 'r' may cause dead loop
Date: Fri, 04 Mar 2011 10:05:49 +0000	[thread overview]
Message-ID: <C99669FD.14216%keir.xen@gmail.com> (raw)
In-Reply-To: <F26D193E20BBDC42A43B611D1BDEDE7125E7A28293@shsmsx502.ccr.corp.intel.com>

On 04/03/2011 09:40, "Wei, Gang" <gang.wei@intel.com> wrote:

> Recently I found dump runq with debug key 'r' may cause dead loop like below:
> 
> (XEN) active vcpus:
> (XEN)    1: [1.0] pri=0 flags=0 cpu=0 credit=263 [w=256]
> (XEN)    2: [0.2] pri=0 flags=0 cpu=5 credit=284 [w=256]
> (XEN)    3: [0.2] pri=0 flags=0 cpu=5 credit=282 [w=256]
> ...
> (XEN)  xxxxx: [0.2] pri=0 flags=0 cpu=2 credit=54 [w=256]
> ...
> (XEN)  xxxxx: [0.2] pri=0 flags=0 cpu=3 credit=-48 [w=256]
> ...
> 
> This means the active vcpu 0.2 became non-active just after it was access in
> the loop '2:', and that list element became empty state (head->next==next).
> 
> Should we always hold a lock before access any schedule related list, even in
> the debug purpose dump code? If it is not acceptable, then we'd better add a
> list_empty() check in the dump functions which access schedule related list at
> least to avoid such a dead loop.

The appropriate lock should be taken. Please send a patch.

 -- Keir

> Jimmy
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-03-04 10:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04  9:40 dump runq with debug key 'r' may cause dead loop Wei, Gang
2011-03-04 10:05 ` Keir Fraser [this message]
2011-03-04 14:51   ` [PATCH]sched_credit: Hold lock while dump scheduler info (RE: dump runq with debug key 'r' may cause dead loop) Wei, Gang

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=C99669FD.14216%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=gang.wei@intel.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 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).