From: Keir Fraser <keir.xen@gmail.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Keir Fraser <keir@xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
"Tim (Xen.org)" <tim@xen.org>,
Julien Grall <julien.grall@citrix.com>
Subject: Re: [PATCH v9 1/2] xen: introduce vcpu_block
Date: Mon, 29 Apr 2013 11:29:19 +0100 [thread overview]
Message-ID: <CDA40A0F.233EB%keir.xen@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1304291114450.5398@kaball.uk.xensource.com>
On 29/04/2013 11:15, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>
wrote:
> forgot to CC the Xen maintainers on this one
Acked-by: Keir Fraser <keir@xen.org>
> On Tue, 23 Apr 2013, Stefano Stabellini wrote:
>> Rename do_block to vcpu_block.
>>
>> Move the call to local_event_delivery_enable out of vcpu_block, to a new
>> static function called vcpu_block_enable_events.
>>
>> Use vcpu_block_enable_events instead of do_block throughout in
>> schedule.c
>>
>>
>> Changes in v9:
>> - return void from vcpu_block and vcpu_block_enable_events;
>> - make vcpu_block_enable_events static.
>>
>> 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 <stefano.stabellini@eu.citrix.com>
>> ---
>> xen/common/schedule.c | 13 ++++++++-----
>> xen/include/xen/sched.h | 1 +
>> 2 files changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
>> index c1cd3d0..e526602 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)
>> +void 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. */
>> @@ -694,8 +693,12 @@ static long do_block(void)
>> TRACE_2D(TRC_SCHED_BLOCK, v->domain->domain_id, v->vcpu_id);
>> raise_softirq(SCHEDULE_SOFTIRQ);
>> }
>> +}
>>
>> - return 0;
>> +static void vcpu_block_enable_events(void)
>> +{
>> + local_event_delivery_enable();
>> + vcpu_block();
>> }
>>
>> static long do_poll(struct sched_poll *sched_poll)
>> @@ -870,7 +873,7 @@ long do_sched_op_compat(int cmd, unsigned long arg)
>>
>> case SCHEDOP_block:
>> {
>> - ret = do_block();
>> + vcpu_block_enable_events();
>> break;
>> }
>>
>> @@ -907,7 +910,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void)
>> arg)
>>
>> case SCHEDOP_block:
>> {
>> - ret = do_block();
>> + vcpu_block_enable_events();
>> break;
>> }
>>
>> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
>> index ad971d2..beadc42 100644
>> --- a/xen/include/xen/sched.h
>> +++ b/xen/include/xen/sched.h
>> @@ -690,6 +690,7 @@ static inline int vcpu_runnable(struct vcpu *v)
>> atomic_read(&v->domain->pause_count));
>> }
>>
>> +void vcpu_block(void);
>> void vcpu_unblock(struct vcpu *v);
>> void vcpu_pause(struct vcpu *v);
>> void vcpu_pause_nosync(struct vcpu *v);
>> --
>> 1.7.2.5
>>
next prev parent reply other threads:[~2013-04-29 10:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 11:19 [PATCH v9 0/2] vcpu_block and WFI trapping Stefano Stabellini
2013-04-23 11:19 ` [PATCH v9 1/2] xen: introduce vcpu_block Stefano Stabellini
2013-04-29 10:15 ` Stefano Stabellini
2013-04-29 10:29 ` Keir Fraser [this message]
2013-04-30 10:58 ` Ian Campbell
2013-04-23 11:19 ` [PATCH v9 2/2] xen/arm: trap guest WFI Stefano Stabellini
2013-04-29 9:22 ` Ian Campbell
2013-04-29 18:09 ` Stefano Stabellini
2013-04-30 8:50 ` Ian Campbell
2013-04-30 17:48 ` Stefano Stabellini
2013-05-01 9:53 ` Ian Campbell
2013-05-01 10:28 ` Stefano Stabellini
2013-04-28 14:32 ` [PATCH v9 0/2] vcpu_block and WFI trapping Stefano Stabellini
2013-04-29 9:17 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CDA40A0F.233EB%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@citrix.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.