All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: George Dunlap <george.dunlap@citrix.com>, xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anshul Makkar <anshul.makkar@citrix.com>
Subject: Re: [PATCH v2 5/7] xen: credit1: increase efficiency and scalability of load balancing.
Date: Fri, 7 Apr 2017 16:49:06 +0200	[thread overview]
Message-ID: <1491576546.3287.16.camel@citrix.com> (raw)
In-Reply-To: <1568f464-29a4-6330-3902-a36f3eb62775@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 2313 bytes --]

On Fri, 2017-04-07 at 15:38 +0100, George Dunlap wrote:
> On 06/04/17 09:16, Dario Faggioli wrote:
> > --- a/xen/common/sched_credit.c
> > +++ b/xen/common/sched_credit.c
> > @@ -1738,14 +1800,13 @@ csched_load_balance(struct csched_private
> > *prv, int cpu,
> >                   * could cause a deadlock if the peer CPU is also
> > load
> >                   * balancing and trying to lock this CPU.
> >                   */
> > -                spinlock_t *lock =
> > pcpu_schedule_trylock(peer_cpu);
> > +                lock = pcpu_schedule_trylock(peer_cpu);
> >                  SCHED_STAT_CRANK(steal_trylock);
> >                  if ( !lock )
> >                  {
> >                      SCHED_STAT_CRANK(steal_trylock_failed);
> >                      TRACE_2D(TRC_CSCHED_STEAL_CHECK, peer_cpu, /*
> > skipp'n */ 0);
> > -                    peer_cpu = cpumask_cycle(peer_cpu, &workers);
> > -                    continue;
> > +                    goto next_cpu;
> 
> Wait -- does this mean that before this patch, this effectively
> busy-waited until peer_cpu was actually free (since peer_cpu was
> never
> incremented)?
> 
Err, what do you mean? peer_cpu is updated here, with the result of
cpumask_cycle(), run on workers, starting from the the current value of
peer_cpu itself.

So, no, we don't busy wait try-locking on the same pcpu, we try all of
them, one after the other (in a node-wise fashion, thanks to the outer
loop).

If this is what you were asking....

> I like the idea in general, but I'm not a fan of the current way of
> doing the accounting -- it seems like too many special cases.  Let me
> have a think about this and come back to it.
> 
Ok. I'm not sure I see what you mean with 'accounting' in this context,
but, yeah, go ahead and let me know. :-)

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

  reply	other threads:[~2017-04-07 14:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06  8:16 [PATCH v2 0/7] xen: sched: improve scalability of Credit1, and optimize a bit both Credit1 and Credit2 Dario Faggioli
2017-04-06  8:16 ` [PATCH v2 1/7] xen: credit1: simplify csched_runq_steal() a little bit Dario Faggioli
2017-04-07 10:45   ` George Dunlap
2017-04-07 11:00     ` Dario Faggioli
2017-04-06  8:16 ` [PATCH v2 2/7] xen: credit: (micro) optimize csched_runq_steal() Dario Faggioli
2017-04-07 10:49   ` George Dunlap
2017-04-07 11:01     ` Dario Faggioli
2017-04-06  8:16 ` [PATCH v2 3/7] xen: credit: consider tickled pCPUs as busy Dario Faggioli
2017-04-07 10:56   ` George Dunlap
2017-04-07 12:53     ` Dario Faggioli
2017-04-06  8:16 ` [PATCH v2 4/7] xen/tools: tracing: add record for credit1 runqueue stealing Dario Faggioli
2017-04-07 11:01   ` George Dunlap
2017-04-07 13:06     ` Dario Faggioli
2017-04-06  8:16 ` [PATCH v2 5/7] xen: credit1: increase efficiency and scalability of load balancing Dario Faggioli
2017-04-07 14:38   ` George Dunlap
2017-04-07 14:49     ` Dario Faggioli [this message]
2017-04-07 15:17       ` George Dunlap
2017-04-07 15:26         ` Dario Faggioli
2017-04-07 15:49           ` Dario Faggioli
2017-04-07 16:25             ` Dario Faggioli
2017-04-06  8:16 ` [PATCH v2 6/7] xen: credit1: treat pCPUs more evenly during balancing Dario Faggioli
2017-04-07 14:44   ` George Dunlap
2017-04-06  8:17 ` [PATCH v2 7/7] xen: credit2: avoid cpumask_any() in pick_cpu() Dario Faggioli
2017-04-07 14:48   ` 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=1491576546.3287.16.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anshul.makkar@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=george.dunlap@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 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.