public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robin Holt <holt@sgi.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Robin Holt <holt@sgi.com>, Thomas Gleixner <tglx@linutronix.de>,
	Yinghai Lu <yinghai@kernel.org>, Andi Kleen <andi@firstfloor.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>
Subject: Re: [RFC 2/2] Make x86 calibrate_delay run in parallel.
Date: Thu, 31 Mar 2011 06:50:14 -0500	[thread overview]
Message-ID: <20110331115014.GF24046@sgi.com> (raw)
In-Reply-To: <20110331095705.GA23319@elte.hu>

On Thu, Mar 31, 2011 at 11:57:05AM +0200, Ingo Molnar wrote:
> 
> * Robin Holt <holt@sgi.com> wrote:
> 
> > On Thu, Mar 31, 2011 at 08:58:05AM +0200, Ingo Molnar wrote:
> > > 
> > > * Ingo Molnar <mingo@elte.hu> wrote:
> > > 
> > > > 
> > > > * Yinghai Lu <yinghai@kernel.org> wrote:
> > > > 
> > > > > On Tue, Dec 14, 2010 at 5:58 PM,  <Robin@sgi.com> wrote:
> > > > > >
> > > > > > On a 4096 cpu machine, we noticed that 318 seconds were taken for bringing
> > > > > > up the cpus.  By specifying lpj=<value>, we reduced that to 75 seconds.
> > > > > > Andi Kleen suggested we rework the calibrate_delay calls to run in
> > > > > > parallel.  With that code in place, a test boot of the same machine took
> > > > > > 61 seconds to bring the cups up.  I am not sure how we beat the lpj=
> > > > > > case, but it did outperform.
> > > > > >
> > > > > > One thing to note is the total BogoMIPS value is also consistently higher.
> > > > > > I am wondering if this is an effect with the cores being in performance
> > > > > > mode.  I did notice that the parallel calibrate_delay calls did cause the
> > > > > > fans on the machine to ramp up to full speed where the normal sequential
> > > > > > calls did not cause them to budge at all.
> > > > > 
> > > > > please check attached patch, that could calibrate correctly.
> > > > > 
> > > > > Thanks
> > > > > 
> > > > > Yinghai
> > > > 
> > > > > [PATCH -v2] x86: Make calibrate_delay run in parallel.
> > > > > 
> > > > > On a 4096 cpu machine, we noticed that 318 seconds were taken for bringing
> > > > > up the cpus.  By specifying lpj=<value>, we reduced that to 75 seconds.
> > > > > Andi Kleen suggested we rework the calibrate_delay calls to run in
> > > > > parallel.
> > > > 
> > > > The risk wit that suggestion is that it will spectacularly miscalibrate on 
> > > > hyperthreading systems.
> > 
> > I am not trying to be argumentative.  I never got an understanding of
> > what was going wrong with that earlier patch and am hoping for some
> > understanding now.
> 
> Well, if calibrate_delay() calls run in parallel then different hyperthreads 
> will impact each other.
> 
> > Why does it spectacularly miscalibrate?  Can anything be done to correct
> > that miscalibration?  Doesn't this patch indicate another problem with
> > the calibration for hotplug cpus?  Isn't there already a problem if
> > you boot a cpu normally, then hot-remove a hyperthread of a cpu, run a
> > userland task which fully loads up all the cores on that socket, then
> > hot-add that hyperthread back in?  If the lpj value is that volatile,
> > what value does it really have?
> 
> The typical CPU hotplug usecase is suspend/resume, where we bring down the CPUs 
> in a more or less controlled manner.
> 
> Yes, you could achieve something similar by frobbing /sys/*/*/online but that's 
> a big difference to *always* running the calibration loops in parallel.
> 
> I'd argue for the opposite direction: only calibrate a physical CPU once per 
> CPU per bootup - this would also make CPU hotplug faster btw.
> 
> ( Virtual CPUs (KVM, etc.) need a recalibration per bringup, because the new 
>   CPU could be running on different hardware - but that's a detail: 4096 UV
>   CPUs are not in this category. )
> 
> Really, there's no good reason why every CPU should be calibrated on a system 
> running identical CPUs, right? Mixed-frequency systems are rather elusive on 
> x86.

I had argued initially for calibrating a single core per socket
earlier.  I do not remember who indicated that would not work, but I
do recall something about some AMD hardware possibly not having the
same frequency for all cores.  Do know any details about any offering
where the individual cores on a socket can have different lpj values
(other than calculation noise)?

Robin

  parent reply	other threads:[~2011-03-31 11:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15  1:58 [RFC 0/2] Speed large x86_64 system boot by calling calibrate_delay() in parallel Robin, Holt <holt
2010-12-15  1:58 ` [RFC 1/2] Pass loops_per_jiffy in and out of calibrate_delay() Robin, Holt <holt
2010-12-15  1:58 ` [RFC 2/2] Make x86 calibrate_delay run in parallel Robin, Holt <holt
2010-12-16  8:34   ` Thomas Gleixner
2011-03-31  4:46   ` Yinghai Lu
2011-03-31  6:50     ` Ingo Molnar
2011-03-31  6:58       ` Ingo Molnar
2011-03-31  9:37         ` Robin Holt
2011-03-31  9:57           ` Ingo Molnar
2011-03-31 10:30             ` Avi Kivity
2011-03-31 10:46               ` Ingo Molnar
2011-03-31 10:49                 ` Avi Kivity
2011-03-31 11:13                   ` Ingo Molnar
2011-03-31 11:50             ` Robin Holt [this message]
2011-03-31  9:29     ` Robin Holt
2011-03-31 14:25       ` Yinghai Lu

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=20110331115014.GF24046@sgi.com \
    --to=holt@sgi.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=yinghai@kernel.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