commit fd8fe6d8526cc9d6abe510aae7a654d1b72d4305 Author: George Dunlap Commit: George Dunlap George's mods diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 6ccc6f0..3e1720c 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -353,8 +353,8 @@ struct csched2_runqueue_data { struct list_head svc; /* List of all vcpus assigned to this runqueue */ unsigned int max_weight; - cpumask_t idle, /* Currently idle */ - smt_idle, /* Fully idle cores (as in all the siblings are idle) */ + cpumask_t idle, /* Currently idle pcpus */ + smt_idle, /* Fully idle-and-untickled cores (see below) */ tickled; /* Have been asked to go through schedule */ int load; /* Instantaneous load: Length of queue + num non-idle threads */ s_time_t load_last_update; /* Last time average was updated */ @@ -454,17 +454,20 @@ struct csched2_dom { */ /* - * If all the siblings of cpu (including cpu itself) are in idlers, - * set all their bits in mask. - * - * In order to properly take into account tickling, idlers needs to be - * set qeual to something like: - * - * rqd->idle & (~rqd->tickled) - * - * This is because cpus that have been tickled will very likely pick up some - * work as soon as the manage to schedule, and hence we should really consider - * them as busy. + * If all the siblings of cpu (including cpu itself) are both idle and + * untickled, set all their bits in mask. + * + * NB that rqd->smt_idle is different than rqd->idle. rqd->idle + * records pcpus that at are merely idle (i.e., at the moment do not + * have a vcpu running on them). But you have to manually filter out + * which pcpus have been tickled in order to find cores that are not + * going to be busy soon. Filtering out tickled cpus pairwise is a + * lot of extra pain; so for rqd->smt_idle, we explicitly make so that + * the bits of a pcpu are set only if all the threads on its core are + * both idle *and* untickled. + * + * This means changing the mask when either rqd->idle or rqd->tickled + * changes. */ static inline void smt_idle_mask_set(unsigned int cpu, const cpumask_t *idlers,