From: Ryan Harper <ryanh@us.ibm.com>
To: xen-devel@lists.xensource.com
Cc: Dan Smith <danms@us.ibm.com>,
"Puthiyaparambil, Aravindh" <aravindh.puthiyaparambil@unisys.com>
Subject: [PATCH] workaround for bug#197: second try
Date: Tue, 13 Sep 2005 13:22:19 -0500 [thread overview]
Message-ID: <20050913182219.GA11410@us.ibm.com> (raw)
In-Reply-To: <20050912212740.GB8009@us.ibm.com>
Thanks for trying out the last patch. While the previous workaround worked for
me, it did not for others. Looking into domain_pause(), we can see that
vcpu_sleep_sync() is called on each vcpu:
/*
* We can be sure that the VCPU is finally descheduled after the running
* flag is cleared and the scheduler lock is released.
*/
while ( test_bit(_VCPUF_running, &v->vcpu_flags)
&& !domain_runnable(v)
&& spin_is_locked(&schedule_data[v->processor].schedule_lock) )
cpu_relax();
If we are to believe the comment, (which makes sense), then the while loop code
is broken. That is, this function will spin until *any* of the three tests
returns false rather than waiting until *all* tests are false. This patch
switches the &&s to ||s and inverts the domain_runnable() check. I believe we
want to spin while 1) vcpu_running flag is up 2) the domain is runnable and 3)
the scheduler lock is held.
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253 T/L: 678-9253
ryanh@us.ibm.com
diffstat output:
schedule.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
#
# fix logic to match comments. ie. we want to spin until
# 1) the running flag is down,
# 2) the domain isnt runnable (pausecnt > 0)
# 3) the scheduler lock isnt held
#
# Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
#
diff -r 413c911e5780 xen/common/schedule.c
--- a/xen/common/schedule.c Mon Sep 12 12:48:33 2005
+++ b/xen/common/schedule.c Tue Sep 13 09:46:36 2005
@@ -214,8 +214,8 @@
* flag is cleared and the scheduler lock is released.
*/
while ( test_bit(_VCPUF_running, &v->vcpu_flags)
- && !domain_runnable(v)
- && spin_is_locked(&schedule_data[v->processor].schedule_lock) )
+ || domain_runnable(v)
+ || spin_is_locked(&schedule_data[v->processor].schedule_lock) )
cpu_relax();
sync_vcpu_execstate(v);
next prev parent reply other threads:[~2005-09-13 18:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-09 22:07 bugzilla #197 fast create/destroy BUG_ON() Ryan Harper
2005-09-12 21:27 ` [PATCH] workaround for bug#197 Ryan Harper
2005-09-12 23:07 ` Dan Smith
2005-09-13 18:22 ` Ryan Harper [this message]
2005-09-13 19:04 ` [PATCH] workaround for bug#197: second try Keir Fraser
2005-09-13 19:23 ` Dan Smith
-- strict thread matches above, loose matches on Subject: below --
2005-09-13 18:29 Puthiyaparambil, Aravindh
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=20050913182219.GA11410@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=aravindh.puthiyaparambil@unisys.com \
--cc=danms@us.ibm.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.