[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH RFC 19/49] xen/sched: add domain pointer to struct sched_item



Add a pointer to the domain to struct sched_item in order to avoid
having to dereference the vcpu pointer of struct sched_item to find
the related domain.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/common/schedule.c      | 3 ++-
 xen/include/xen/sched-if.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 99660cee67..625d6287c2 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -257,7 +257,7 @@ static void sched_spin_unlock_double(spinlock_t *lock1, 
spinlock_t *lock2,
 static void sched_free_item(struct sched_item *item)
 {
     struct sched_item *prev_item;
-    struct domain *d = item->vcpu->domain;
+    struct domain *d = item->domain;
 
     if ( d->sched_item_list == item )
         d->sched_item_list = item->next_in_list;
@@ -293,6 +293,7 @@ static struct sched_item *sched_alloc_item(struct vcpu *v)
 
     v->sched_item = item;
     item->vcpu = v;
+    item->domain = d;
 
     for ( prev_item = &d->sched_item_list; *prev_item;
           prev_item = &(*prev_item)->next_in_list )
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index b5cbbbbcb1..9a524014d0 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -50,6 +50,7 @@ DECLARE_PER_CPU(struct cpupool *, cpupool);
 DECLARE_PER_CPU(struct sched_resource *, sched_res);
 
 struct sched_item {
+    struct domain         *domain;
     struct vcpu           *vcpu;
     void                  *priv;      /* scheduler private data */
     struct sched_item     *next_in_list;
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.