diff mbox series

[RFC,20/49] xen/sched: add id to struct sched_item

Message ID 20190329150934.17694-21-jgross@suse.com (mailing list archive)
State Superseded
Headers show
Series xen: add core scheduling support | expand

Commit Message

Jürgen Groß March 29, 2019, 3:09 p.m. UTC
Add an identifier to sched_item. For now it will be the same as the
related vcpu_id.

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

Patch

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 625d6287c2..7a7ec56402 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -293,12 +293,13 @@  static struct sched_item *sched_alloc_item(struct vcpu *v)
 
     v->sched_item = item;
     item->vcpu = v;
+    item->item_id = v->vcpu_id;
     item->domain = d;
 
     for ( prev_item = &d->sched_item_list; *prev_item;
           prev_item = &(*prev_item)->next_in_list )
         if ( (*prev_item)->next_in_list &&
-             (*prev_item)->next_in_list->vcpu->vcpu_id > v->vcpu_id )
+             (*prev_item)->next_in_list->item_id > item->item_id )
             break;
 
     item->next_in_list = *prev_item;
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 9a524014d0..1e4a7e1e64 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -55,6 +55,7 @@  struct sched_item {
     void                  *priv;      /* scheduler private data */
     struct sched_item     *next_in_list;
     struct sched_resource *res;
+    int                    item_id;
 
     /* Last time when item has been scheduled out. */
     uint64_t               last_run_time;