From: Dario Faggioli Subject: [PATCH 1/7] xen: sched_rt: avoid ASSERT()ing on runq dump if there are no domains Date: Mon, 16 Mar 2015 18:04:50 +0100 Message-ID: <20150316170450.10279.38060.stgit@Solace.station> References: <20150316165642.10279.86684.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150316165642.10279.86684.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: George Dunlap , Keir Fraser , Meng Xu , Jan Beulich List-Id: xen-devel@lists.xenproject.org being serviced by the RTDS scheduler, as that is a legit situation to be in: think, for instance, of a newly created RTDS cpupool, with no domains migrated to it yet. Signed-off-by: Dario Faggioli Cc: George Dunlap Cc: Meng Xu Cc: Jan Beulich Cc: Keir Fraser --- xen/common/sched_rt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index df4adac..055a50f 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -264,18 +264,17 @@ rt_dump(const struct scheduler *ops) struct list_head *iter_sdom, *iter_svc, *runq, *depletedq, *iter; struct rt_private *prv = rt_priv(ops); struct rt_vcpu *svc; - cpumask_t *online; struct rt_dom *sdom; unsigned long flags; - ASSERT(!list_empty(&prv->sdom)); + spin_lock_irqsave(&prv->lock, flags); + + if (list_empty(&prv->sdom)) + goto out; - sdom = list_entry(prv->sdom.next, struct rt_dom, sdom_elem); - online = cpupool_scheduler_cpumask(sdom->dom->cpupool); runq = rt_runq(ops); depletedq = rt_depletedq(ops); - spin_lock_irqsave(&prv->lock, flags); printk("Global RunQueue info:\n"); list_for_each( iter, runq ) { @@ -303,6 +302,7 @@ rt_dump(const struct scheduler *ops) } } +out: spin_unlock_irqrestore(&prv->lock, flags); }