From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH v8 1/2] xen: introduce vcpu_block and vcpu_block_enable_events Date: Mon, 22 Apr 2013 21:00:27 +0100 Message-ID: References: <1366652540-24208-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366652540-24208-1-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini , xen-devel@lists.xensource.com Cc: julien.grall@citrix.com, tim@xen.org, Ian.Campbell@citrix.com, JBeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 22/04/2013 18:42, "Stefano Stabellini" wrote: > Rename do_block to vcpu_block. > > Move the call to local_event_delivery_enable out of vcpu_block, to a new > function called vcpu_block_enable_events. > > Use vcpu_block_enable_events instead of do_block throughout in > schedule.c While you're there, could you make both vcpu_block variants return void? -- Keir > > Changes in v8: > - rename do_block to vcpu_block; > - move local_event_delivery_enable out of vcpu_block to > vcpu_block_enable_events. > > Changes in v7: > - introduce a event_delivery_enable parameter to make the call to > local_event_delivery_enable conditional; > - export do_block as is. > > Signed-off-by: Stefano Stabellini > --- > xen/common/schedule.c | 13 +++++++++---- > xen/include/xen/sched.h | 2 ++ > 2 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/xen/common/schedule.c b/xen/common/schedule.c > index c1cd3d0..489c23d 100644 > --- a/xen/common/schedule.c > +++ b/xen/common/schedule.c > @@ -677,11 +677,10 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t > *affinity) > } > > /* Block the currently-executing domain until a pertinent event occurs. */ > -static long do_block(void) > +long vcpu_block(void) > { > struct vcpu *v = current; > > - local_event_delivery_enable(); > set_bit(_VPF_blocked, &v->pause_flags); > > /* Check for events /after/ blocking: avoids wakeup waiting race. */ > @@ -698,6 +697,12 @@ static long do_block(void) > return 0; > } > > +long vcpu_block_enable_events(void) > +{ > + local_event_delivery_enable(); > + return vcpu_block(); > +} > + > static long do_poll(struct sched_poll *sched_poll) > { > struct vcpu *v = current; > @@ -870,7 +875,7 @@ long do_sched_op_compat(int cmd, unsigned long arg) > > case SCHEDOP_block: > { > - ret = do_block(); > + ret = vcpu_block_enable_events(); > break; > } > > @@ -907,7 +912,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) > arg) > > case SCHEDOP_block: > { > - ret = do_block(); > + ret = vcpu_block_enable_events(); > break; > } > > diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h > index ad971d2..1347138 100644 > --- a/xen/include/xen/sched.h > +++ b/xen/include/xen/sched.h > @@ -690,6 +690,8 @@ static inline int vcpu_runnable(struct vcpu *v) > atomic_read(&v->domain->pause_count)); > } > > +long vcpu_block(void); > +long vcpu_block_enable_events(void); > void vcpu_unblock(struct vcpu *v); > void vcpu_pause(struct vcpu *v); > void vcpu_pause_nosync(struct vcpu *v);