From: Dario Faggioli <raistlin@linux.it>
To: xen-devel@lists.xensource.com
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
Juergen Gross <juergen.gross@ts.fujitsu.com>,
Keir Fraser <keir@xen.org>
Subject: [RFC/RFT][PATCH 2 of 3] Remove VCPU pausing while adjusting domain scheduling parameters.
Date: Wed, 23 Nov 2011 16:09:22 +0100 [thread overview]
Message-ID: <1322060962.30168.20.camel@Abyss> (raw)
In-Reply-To: <1322060131.30168.15.camel@Abyss>
[-- Attachment #1.1: Type: text/plain, Size: 2096 bytes --]
Pausing all the non-current VCPUs of a domain while changing its
scheduling parameters is dangerous (what if two VCPUs try to pause
all the other VCPUs but themselves at the same time?). Moreover, it
does not appear to be needed, since:
- races are (or should be) avoided within each pluggable scheduler
by means of proper locking;
- changes in values using during actual scheduling are (or should be)
prevented by runq locking.
Just remove it.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
diff -r 6b5e2eb81706 xen/common/schedule.c
--- a/xen/common/schedule.c Wed Nov 23 15:09:14 2011 +0100
+++ b/xen/common/schedule.c Wed Nov 23 15:20:28 2011 +0100
@@ -1005,7 +1005,6 @@ int sched_id(void)
/* Adjust scheduling parameter for a given domain. */
long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
{
- struct vcpu *v;
long ret;
if ( (op->sched_id != DOM2OP(d)->sched_id) ||
@@ -1013,27 +1012,11 @@ long sched_adjust(struct domain *d, stru
(op->cmd != XEN_DOMCTL_SCHEDOP_getinfo)) )
return -EINVAL;
- /*
- * Most VCPUs we can simply pause. If we are adjusting this VCPU then
- * concurrent updates shall be prevented within the actual pluggable
- * scheduler.
- */
-
- for_each_vcpu ( d, v )
- {
- if ( v != current )
- vcpu_pause(v);
- }
-
+ /* NB: the pluggable scheduler code needs to take care
+ * of locking by itself. */
if ( (ret = SCHED_OP(DOM2OP(d), adjust, d, op)) == 0 )
TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
- for_each_vcpu ( d, v )
- {
- if ( v != current )
- vcpu_unpause(v);
- }
-
return ret;
}
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-------------------------------------------------------------------
Dario Faggioli, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
PhD Candidate, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa (Italy)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-11-23 15:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 14:55 [RFC/RFT][PATCH 0 of 3] rework locking in sched_adjust Dario Faggioli
2011-11-23 15:07 ` [RFC/RFT][PATCH 1 of 3] Move locking into pluggable schedulers Dario Faggioli
2011-11-23 16:24 ` Ian Campbell
2011-11-23 17:09 ` Dario Faggioli
2011-11-23 17:30 ` Ian Campbell
2011-12-06 10:34 ` George Dunlap
2011-12-06 16:35 ` Dario Faggioli
2011-12-07 14:49 ` [PATCHv2 0 of 1] Rework locking for sched_adjust Dario Faggioli
2011-12-07 15:02 ` [PATCHv2 1 " Dario Faggioli
2011-12-14 10:24 ` George Dunlap
2011-12-07 15:04 ` [PATCHv2 0 " Dario Faggioli
2011-11-23 15:09 ` Dario Faggioli [this message]
2011-11-23 15:11 ` [RFC/RFT][PATCH 3 of 3] Introduce proper locking in sedf Dario Faggioli
2011-12-06 8:38 ` [RFC/RFT][PATCH 0 of 3] rework locking in sched_adjust Juergen Gross
2011-12-06 10:10 ` Dario Faggioli
2011-12-06 11:03 ` Juergen Gross
2011-12-06 12:30 ` George Dunlap
2011-12-06 12:39 ` Juergen Gross
2011-12-06 16:39 ` Dario Faggioli
2011-12-06 12:24 ` George Dunlap
2011-12-06 16:46 ` Dario Faggioli
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=1322060962.30168.20.camel@Abyss \
--to=raistlin@linux.it \
--cc=George.Dunlap@eu.citrix.com \
--cc=juergen.gross@ts.fujitsu.com \
--cc=keir@xen.org \
--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.