linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org,
	Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
	Stewart Smith <stewart@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/3] powerpc/powernv: Avoid the secondary hold spinloop for OPAL boot
Date: Thu, 12 Oct 2017 00:00:26 +1000	[thread overview]
Message-ID: <20171012000026.044e5a9b@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <874lr5zzz8.fsf@concordia.ellerman.id.au>

On Wed, 11 Oct 2017 22:27:23 +1100
Michael Ellerman <mpe@ellerman.id.au> wrote:

> Nicholas Piggin <npiggin@gmail.com> writes:
> 
> > On Wed, 11 Oct 2017 01:58:28 +1000
> > Nicholas Piggin <npiggin@gmail.com> wrote:
> >
> >  
> >> Ahh okay, pseries is using the start-cpu RTAS call to enter at
> >> generic_secondary_smp_init() as well. So we can take it out for
> >> pseries as well.  
> >
> > This patch seems to do the trick for pseries guests too:
> >
> > powerpc/64s: Avoid waiting for secondary hold spinloop if it is not used
> >
> > OPAL and some RTAS boot does not insert secondaries at 0x60 to wait at
> > the secondary hold spinloop. Instead they are started later, at
> > generic_secondary_smp_init(), which is after the secondary hold
> > spinloop.
> >
> > Avoid waiting on this spinloop when booting with OPAL firmware, or
> > when the RTAS boot does not use this loop. This wait always times
> > out in those cases.
> >
> > This saves 100ms boot time on bare metal (10s of seconds of real time
> > when booting on the simulator in SMP), and 100ms on modern pseries
> > guests.  
> 
> My instinct was to say "huh, that's not how it works on pseries!".
> 
> But then I see this was all changed in:
> 
>   dbe78b401186 ("powerpc/pseries: Do not start secondaries in Open Firmware") (Sep 2013)
> 
> 
> So that is where my confusion comes from. Most of the code and comments
> still talk about secondaries coming in at 0x60, but that's really only
> on "legacy" machines.
> 
> I guess I can merge this, but really this code needs a proper cleanup. I
> dislike all this platform specific knowledge ending up in setup_64.c.
> 
> If we had an smp_ops->spinning_secondaries() that tells the spin
> loop how many secondaries to wait for, it could all go in platform code
> I think.

Yeah, not sure how best to do it. What I wanted to do was just increment
spinning_secondaries in prom_init as we inserted them to 0x60 (or the
0x100 for pmac or whatever). But prom_init doesn't like referencing outside
variables so there goes that.

> 
> The check for use_spinloop() would just become a short-circuit check of
> spinning_secondaries == 0.

Yeah maybe that would be enough. I don't know if half that setup_arch
could be per-platformirized, including smp_release_cpus().

> 
> The other issue is kexec. IIRC when we kexec on pseries we don't return
> the CPUs to RTAS, so then they *are* spinning at 0x60. But maybe that's
> changed since I last looked at it too :)

Oh I might have forgotten to test that on pseries, so I'll try that.

Thanks,
Nick

  reply	other threads:[~2017-10-11 14:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06  6:10 [PATCH 0/3] some boot/shutdown improvements Nicholas Piggin
2017-10-06  6:10 ` [PATCH 1/3] powerpc/powernv: Avoid the secondary hold spinloop for OPAL boot Nicholas Piggin
2017-10-10 11:11   ` Michael Ellerman
2017-10-10 11:44     ` Nicholas Piggin
2017-10-10 15:58       ` Nicholas Piggin
2017-10-10 18:52         ` Nicholas Piggin
2017-10-11 11:27           ` Michael Ellerman
2017-10-11 14:00             ` Nicholas Piggin [this message]
2017-10-06  6:10 ` [PATCH 2/3] powerpc/powernv: Always stop secondaries before reboot/shutdown Nicholas Piggin
2017-10-06  6:10 ` [PATCH 3/3] powerpc: use NMI IPI for smp_send_stop Nicholas Piggin

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=20171012000026.044e5a9b@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=hegdevasant@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=stewart@linux.vnet.ibm.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 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).