All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <stefano@aporeto.com>,
	Jonathan Davies <Jonathan.Davies@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: Re: [PATCH v2 4/5] xen: sched_null: support for hard affinity
Date: Fri, 7 Apr 2017 11:08:25 +0100	[thread overview]
Message-ID: <2686af52-6e38-61ab-c727-0e9b99740a98@citrix.com> (raw)
In-Reply-To: <149152525510.31941.6625917268878264420.stgit@Solace.fritz.box>

On 07/04/17 01:34, Dario Faggioli wrote:
> As a (rudimental) way of directing and affecting the
> placement logic implemented by the scheduler, support
> vCPU hard affinity.
> 
> Basically, a vCPU will now be assigned only to a pCPU
> that is part of its own hard affinity. If such pCPU(s)
> is (are) busy, the vCPU will wait, like it happens
> when there are no free pCPUs.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

[snip]

> @@ -413,7 +431,6 @@ static void null_vcpu_insert(const struct scheduler *ops, struct vcpu *v)
>  static void _vcpu_remove(struct null_private *prv, struct vcpu *v)
>  {
>      unsigned int cpu = v->processor;
> -    struct domain *d = v->domain;
>      struct null_vcpu *wvc;
>  
>      ASSERT(list_empty(&null_vcpu(v)->waitq_elem));
> @@ -425,7 +442,7 @@ static void _vcpu_remove(struct null_private *prv, struct vcpu *v)
>       * If yes, we assign it to cpu, in spite of v.
>       */
>      wvc = list_first_entry_or_null(&prv->waitq, struct null_vcpu, waitq_elem);
> -    if ( wvc && cpumask_test_cpu(cpu, cpupool_domain_cpumask(d)) )
> +    if ( wvc && vcpu_check_affinity(wvc->vcpu, cpu) )

Hmm, actually I just noticed that this only checks the first item on the
list.  If there are two vcpus on the list, and the first one doesn't
have affinity with the vcpu in question, the second one won't even be
considered.  This was probably OK in the previous case, where the only
time the test could fail is during suspend/resume, but it's not really
OK anymore, I don't think.

Everything else looks OK to me.

 -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-04-07 10:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07  0:33 [PATCH v2 0/5] The 'null' Scheduler Dario Faggioli
2017-04-07  0:33 ` [PATCH v2 1/5] xen: sched: improve robustness (and rename) DOM2OP() Dario Faggioli
2017-04-07  8:44   ` George Dunlap
2017-04-07  9:05     ` Dario Faggioli
2017-04-07  0:34 ` [PATCH v2 2/5] xen: sched: make sure a pCPU added to a pool runs the scheduler ASAP Dario Faggioli
2017-04-07  8:47   ` George Dunlap
2017-04-07  0:34 ` [PATCH v2 3/5] xen: sched: introduce the 'null' semi-static scheduler Dario Faggioli
2017-04-07  7:24   ` Alan Robinson
2017-04-07  9:17   ` George Dunlap
2017-04-07  0:34 ` [PATCH v2 4/5] xen: sched_null: support for hard affinity Dario Faggioli
2017-04-07 10:08   ` George Dunlap [this message]
2017-04-07 10:11     ` Dario Faggioli
2017-04-07  0:34 ` [PATCH v2 5/5] tools: sched: add support for 'null' scheduler Dario Faggioli

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=2686af52-6e38-61ab-c727-0e9b99740a98@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=Jonathan.Davies@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=marcus.granado@citrix.com \
    --cc=stefano@aporeto.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 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.