All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <raistlin@linux.it>
To: George Dunlap <george.dunlap@citrix.com>, xen-devel@lists.xenproject.org
Cc: Anshul Makkar <anshulmakkar@gmail.com>
Subject: Re: [PATCH 3/4] xen: sched: improve checking soft-affinity
Date: Thu, 05 Oct 2017 15:51:49 +0200	[thread overview]
Message-ID: <1507211509.4127.19.camel@linux.it> (raw)
In-Reply-To: <25b5d7c6-7402-6101-2432-50378bbeb232@citrix.com>


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

On Wed, 2017-10-04 at 14:23 +0100, George Dunlap wrote:
> On 09/15/2017 06:35 PM, Dario Faggioli wrote:
> > 
> > diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> > index 3efbfc8..35d0c98 100644
> > --- a/xen/common/sched_credit.c
> > +++ b/xen/common/sched_credit.c
> > @@ -410,8 +410,7 @@ static inline void __runq_tickle(struct
> > csched_vcpu *new)
> >              int new_idlers_empty;
> >  
> >              if ( balance_step == BALANCE_SOFT_AFFINITY
> > -                 && !has_soft_affinity(new->vcpu,
> > -                                       new->vcpu-
> > >cpu_hard_affinity) )
> > +                 && !has_soft_affinity(new->vcpu) )
> >                  continue;
> >  
> >              /* Are there idlers suitable for new (for this balance
> > step)? */
> > @@ -743,50 +742,42 @@ __csched_vcpu_is_migrateable(struct vcpu *vc,
> > int dest_cpu, cpumask_t *mask)
> >  static int
> >  _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc,
> > bool_t commit)
> >  {
> > -    cpumask_t cpus;
> 
> Is there a reason you couldn't use cpumask_t
> *cpus=cpumask_scratch_cpu()?
> 
I was about to say "yes, of course". But while double checking that, I
realized that the patch is actually wrong.

So, even if not 100% intentional... good catch! :-P

In fact, in this function (_csched_cpu_pick()), cpu potentially changes
here:

    cpu = cpumask_test_cpu(vc->processor, cpumask_scratch_cpu(cpu))
            ? vc->processor
            : cpumask_cycle(vc->processor, cpumask_scratch_cpu(cpu));

and here:

    if ( !cpumask_test_cpu(cpu, cpumask_scratch_cpu(cpu)) &&
         !cpumask_empty(cpumask_scratch_cpu(cpu)) )
        cpu = cpumask_cycle(cpu, cpumask_scratch_cpu(cpu));

And it's therefore not ok to continue to use cpumask_scratch_cpu(cpu).

I now have fixed this, but then, while testing, I discovered more, and
much more serious issues.

I'm not actually sure what happened, but it's quite clear I've made a
mess while testing this series (likely, I must mistakenly have tested a
different version of the series, wrt to that I sent).

So I'll send a v3, with the issues I've found fixed, and this time
properly tested.

Sorry everyone, George in particular. :-(

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: 833 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-10-05 13:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 17:35 [PATCH 0/4] xen: sched: optimize exclusive pinning and soft-affinity checking Dario Faggioli
2017-09-15 17:35 ` [PATCH 1/4] xen: sched: introduce 'adjust_affinity' hook Dario Faggioli
2017-10-04 13:34   ` George Dunlap
2017-09-15 17:35 ` [PATCH 2/4] xen: sched: optimize exclusive pinning case (Credit1 & 2) Dario Faggioli
2017-09-20 16:43   ` Anshul Makkar
2017-10-04 13:36   ` George Dunlap
2017-09-15 17:35 ` [PATCH 3/4] xen: sched: improve checking soft-affinity Dario Faggioli
2017-10-04 13:23   ` George Dunlap
2017-10-05 13:51     ` Dario Faggioli [this message]
2017-09-15 17:35 ` [PATCH 4/4] xen: sched: simplify (and speedup) " Dario Faggioli
2017-10-04 13:37   ` George Dunlap
2017-09-18 19:42 ` [PATCH 0/4] xen: sched: optimize exclusive pinning and soft-affinity checking Anshul Makkar
2017-09-19  8:16   ` Dario Faggioli
2017-10-04 13:37 ` 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=1507211509.4127.19.camel@linux.it \
    --to=raistlin@linux.it \
    --cc=anshulmakkar@gmail.com \
    --cc=george.dunlap@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.