xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xenproject.org
Cc: JBeulich@suse.com, julien.grall@linaro.org,
	Ian.Campbell@citrix.com, anup.patel@linaro.org,
	pranavkumar@linaro.org
Subject: Re: [PATCH 1/2] xen: export do_yield as vcpu_yield
Date: Wed, 23 Jul 2014 13:58:35 +0100	[thread overview]
Message-ID: <53CFB17B.1040201@eu.citrix.com> (raw)
In-Reply-To: <1406117103-10584-1-git-send-email-stefano.stabellini@eu.citrix.com>

On 07/23/2014 01:05 PM, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> CC: george.dunlap@eu.citrix.com
> CC: JBeulich@suse.com
> ---
>   xen/common/schedule.c   |   10 +++++-----
>   xen/include/xen/sched.h |    1 +
>   2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index e9eb0bc..6631dc8 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -795,9 +795,8 @@ static long do_poll(struct sched_poll *sched_poll)
>   }
>   
>   /* Voluntarily yield the processor for this allocation. */
> -static long do_yield(void)
> +void vcpu_yield(struct vcpu *v)

What are you actually trying to do here?  Why do you add a vcpu struct, 
when all the callers (including the one you add in 2/2) just pass current?

>   {
> -    struct vcpu * v=current;
>       spinlock_t *lock = vcpu_schedule_lock_irq(v);
>   
>       SCHED_OP(VCPU2OP(v), yield, v);
> @@ -805,7 +804,6 @@ static long do_yield(void)
>   
>       TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
>       raise_softirq(SCHEDULE_SOFTIRQ);

This is broken: it's still tracing current instead of v, and you're 
raising the schedule softirq on the current cpu rather than on the cpu 
on which v is running.  If v!=current, you have to go through force 
reschedule for safety.

Just rename the function and make it non-static, leaving the arguments 
and return value alone.

  -George

  parent reply	other threads:[~2014-07-23 12:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 12:04 [PATCH 0/2] xen/arm: vcpu_yield on WFE Stefano Stabellini
2014-07-23 12:05 ` [PATCH 1/2] xen: export do_yield as vcpu_yield Stefano Stabellini
2014-07-23 12:14   ` Ian Campbell
2014-07-23 12:58   ` George Dunlap [this message]
2014-07-23 13:04     ` Stefano Stabellini
2014-07-23 13:07       ` George Dunlap
2014-07-23 12:05 ` [PATCH 2/2] xen/arm: call vcpu_yield on WFE trap Stefano Stabellini
2014-07-23 13:11   ` George Dunlap
2014-07-23 13:13     ` Stefano Stabellini
2014-07-23 13:29       ` George Dunlap

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=53CFB17B.1040201@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=anup.patel@linaro.org \
    --cc=julien.grall@linaro.org \
    --cc=pranavkumar@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).