@@ -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 )
@@ -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;
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@suse.com> --- xen/common/schedule.c | 3 ++- xen/include/xen/sched.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)