Re: [Xen-devel] [RFC v2 09/15] Add a new per-vCPU tasklet to wakeup the blocked vCPU
>>> On 12.06.15 at 11:40, wrote: >> From: Jan Beulich [mailto:jbeul...@suse.com] >> Sent: Tuesday, June 09, 2015 11:09 PM >> >>> On 08.05.15 at 11:07, wrote: >> > This patch adds a new per-vCPU tasklet to wakeup the blocked >> > vCPU. It can be used in the case vcpu_unblock cannot be called >> > directly. This tasklet will be used in later patch in this >> > series. >> > >> > Signed-off-by: Feng Wu >> > --- >> > xen/common/domain.c | 11 +++ >> > xen/include/xen/sched.h | 3 +++ >> > 2 files changed, 14 insertions(+) >> >> What is the rationale for doing this in common code, modifying >> common structures? >> > > Do you mean moving this tasklet to the architecture specific structure, such > as, struct arch_vcpu ? Exactly. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC v2 09/15] Add a new per-vCPU tasklet to wakeup the blocked vCPU
> -Original Message- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: Tuesday, June 09, 2015 11:09 PM > To: Wu, Feng > Cc: andrew.coop...@citrix.com; george.dun...@eu.citrix.com; Tian, Kevin; > Zhang, Yang Z; xen-devel@lists.xen.org; k...@xen.org > Subject: Re: [RFC v2 09/15] Add a new per-vCPU tasklet to wakeup the blocked > vCPU > > >>> On 08.05.15 at 11:07, wrote: > > This patch adds a new per-vCPU tasklet to wakeup the blocked > > vCPU. It can be used in the case vcpu_unblock cannot be called > > directly. This tasklet will be used in later patch in this > > series. > > > > Signed-off-by: Feng Wu > > --- > > xen/common/domain.c | 11 +++ > > xen/include/xen/sched.h | 3 +++ > > 2 files changed, 14 insertions(+) > > What is the rationale for doing this in common code, modifying > common structures? > Do you mean moving this tasklet to the architecture specific structure, such as, struct arch_vcpu ? Thanks, Feng > Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC v2 09/15] Add a new per-vCPU tasklet to wakeup the blocked vCPU
>>> On 08.05.15 at 11:07, wrote: > This patch adds a new per-vCPU tasklet to wakeup the blocked > vCPU. It can be used in the case vcpu_unblock cannot be called > directly. This tasklet will be used in later patch in this > series. > > Signed-off-by: Feng Wu > --- > xen/common/domain.c | 11 +++ > xen/include/xen/sched.h | 3 +++ > 2 files changed, 14 insertions(+) What is the rationale for doing this in common code, modifying common structures? Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [RFC v2 09/15] Add a new per-vCPU tasklet to wakeup the blocked vCPU
This patch adds a new per-vCPU tasklet to wakeup the blocked vCPU. It can be used in the case vcpu_unblock cannot be called directly. This tasklet will be used in later patch in this series. Signed-off-by: Feng Wu --- xen/common/domain.c | 11 +++ xen/include/xen/sched.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/xen/common/domain.c b/xen/common/domain.c index 6803c4d..95e2a10 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -109,6 +109,13 @@ static void vcpu_check_shutdown(struct vcpu *v) spin_unlock(&d->shutdown_lock); } +static void vcpu_wakeup_tasklet_handler(unsigned long arg) +{ +struct vcpu *v = (void *)arg; + +vcpu_unblock(v); +} + struct vcpu *alloc_vcpu( struct domain *d, unsigned int vcpu_id, unsigned int cpu_id) { @@ -126,6 +133,9 @@ struct vcpu *alloc_vcpu( tasklet_init(&v->continue_hypercall_tasklet, NULL, 0); +tasklet_init(&v->vcpu_wakeup_tasklet, vcpu_wakeup_tasklet_handler, + (unsigned long)v); + if ( !zalloc_cpumask_var(&v->cpu_hard_affinity) || !zalloc_cpumask_var(&v->cpu_hard_affinity_tmp) || !zalloc_cpumask_var(&v->cpu_hard_affinity_saved) || @@ -785,6 +795,7 @@ static void complete_domain_destroy(struct rcu_head *head) if ( (v = d->vcpu[i]) == NULL ) continue; tasklet_kill(&v->continue_hypercall_tasklet); +tasklet_kill(&v->vcpu_wakeup_tasklet); vcpu_destroy(v); sched_destroy_vcpu(v); destroy_waitqueue_vcpu(v); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 80c6f62..fd9e01e 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -239,6 +239,9 @@ struct vcpu /* Tasklet for continue_hypercall_on_cpu(). */ struct tasklet continue_hypercall_tasklet; +/* Tasklet for wakeup_blocked_vcpu(). */ +struct tasklet vcpu_wakeup_tasklet; + /* Multicall information. */ struct mc_state mc_state; -- 2.1.0 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel