[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RFC V2 13/45] 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.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index d56dc567ac..53aac107e1 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -253,7 +253,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; @@ -289,6 +289,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.h b/xen/include/xen/sched.h index b43f5f3662..83d7646088 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -261,6 +261,7 @@ struct vcpu struct sched_resource; 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |