- fix tasklet_schedule_cpu() when invoked from the tasklet's handler - properly balance (un-)pausing in continue_hypercall_on_cpu() code paths - bump domctl interface version (due to the addition of the "cpupool" member to struct xen_domctl_getdomaininfo) - move and rename csched_priv to make sure eventual backported upstream patches using the variable get correctly adjusted (i.e. missing adjustments get detected at build time) - remove boot time per-CPU pool assignment messages (bnc#572146) Index: xen-4.0.0-testing/xen/arch/x86/domain.c =================================================================== --- xen-4.0.0-testing.orig/xen/arch/x86/domain.c +++ xen-4.0.0-testing/xen/arch/x86/domain.c @@ -1580,6 +1580,7 @@ int continue_hypercall_on_cpu(int cpu, v v->arch.schedule_tail = continue_hypercall_on_cpu_helper; v->arch.continue_info = info; + vcpu_pause_nosync(v); } else { @@ -1590,7 +1591,6 @@ int continue_hypercall_on_cpu(int cpu, v info->func = func; info->data = data; - vcpu_pause_nosync(v); tasklet_schedule_cpu(&info->tasklet, cpu); raise_softirq(SCHEDULE_SOFTIRQ); Index: xen-4.0.0-testing/xen/common/sched_credit.c =================================================================== --- xen-4.0.0-testing.orig/xen/common/sched_credit.c +++ xen-4.0.0-testing/xen/common/sched_credit.c @@ -176,7 +176,6 @@ struct csched_private { /* * Global variables */ -static struct csched_private csched_priv; static struct csched_private *csched_priv0 = NULL; static void csched_tick(void *_cpu); @@ -1524,11 +1523,13 @@ static void csched_tick_resume(struct sc } } +static struct csched_private _csched_priv; + struct scheduler sched_credit_def = { .name = "SMP Credit Scheduler", .opt_name = "credit", .sched_id = XEN_SCHEDULER_CREDIT, - .sched_data = &csched_priv, + .sched_data = &_csched_priv, .init_domain = csched_dom_init, .destroy_domain = csched_dom_destroy, Index: xen-4.0.0-testing/xen/common/softirq.c =================================================================== --- xen-4.0.0-testing.orig/xen/common/softirq.c +++ xen-4.0.0-testing/xen/common/softirq.c @@ -104,12 +104,15 @@ static void tasklet_schedule_list(struct { BUG_ON(!list_empty(&t->list)); list_add_tail(&t->list, tlist); + t->scheduled_on = NR_CPUS; } t->is_scheduled = 1; if ( cpu == smp_processor_id() ) raise_softirq(TASKLET_SOFTIRQ); - else + else if ( !t->is_running ) cpu_raise_softirq(cpu, TASKLET_SOFTIRQ); + else + t->scheduled_on = cpu; } spin_unlock_irqrestore(&tasklet_lock, flags); @@ -156,7 +159,15 @@ static void tasklet_action(void) if ( t->is_scheduled ) { BUG_ON(t->is_dead || !list_empty(&t->list)); - list_add_tail(&t->list, tlist); + if ( t->scheduled_on >= NR_CPUS ) + list_add_tail(&t->list, tlist); + else + { + unsigned int cpu = t->scheduled_on; + + list_add_tail(&t->list, &per_cpu(tasklet_list_pcpu, cpu)); + cpu_raise_softirq(cpu, TASKLET_SOFTIRQ); + } } /* Index: xen-4.0.0-testing/xen/include/public/domctl.h =================================================================== --- xen-4.0.0-testing.orig/xen/include/public/domctl.h +++ xen-4.0.0-testing/xen/include/public/domctl.h @@ -35,7 +35,7 @@ #include "xen.h" #include "grant_table.h" -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000006 +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000007 struct xenctl_cpumap { XEN_GUEST_HANDLE_64(uint8) bitmap; Index: xen-4.0.0-testing/xen/include/xen/softirq.h =================================================================== --- xen-4.0.0-testing.orig/xen/include/xen/softirq.h +++ xen-4.0.0-testing/xen/include/xen/softirq.h @@ -50,12 +50,14 @@ struct tasklet bool_t is_scheduled; bool_t is_running; bool_t is_dead; + unsigned int scheduled_on; void (*func)(unsigned long); unsigned long data; }; #define DECLARE_TASKLET(name, func, data) \ - struct tasklet name = { LIST_HEAD_INIT(name.list), 0, 0, 0, func, data } + struct tasklet name = { LIST_HEAD_INIT(name.list), 0, 0, 0, NR_CPUS, \ + func, data } void tasklet_schedule(struct tasklet *t); void tasklet_schedule_cpu(struct tasklet *t, int cpu);