All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jack Steiner <steiner@sgi.com>
Cc: tglx@linutronix.de, davej@redhat.com, yinghan@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86: Reduce clock calibration time during slave cpu startup
Date: Fri, 5 Aug 2011 23:38:36 +0200	[thread overview]
Message-ID: <20110805213836.GB21114@elte.hu> (raw)
In-Reply-To: <20110805131638.GA27779@sgi.com>


* Jack Steiner <steiner@sgi.com> wrote:

> On Fri, Aug 05, 2011 at 12:46:35PM +0200, Ingo Molnar wrote:
> > 
> > * Jack Steiner <steiner@sgi.com> wrote:
> > 
> > > +/*
> > > + * Check if another cpu is in the same socket and has already been calibrated.
> > > + * If found, use the previous value. This assumes all cores in the same physical
> > > + * socket have the same core frequency.
> > > +
> > > +unsigned long __cpuinit calibrate_delay_is_known(void)
> > > +{
> > > +	int i, cpu = smp_processor_id();
> > > +
> > > +	if (!tsc_disabled && !cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC))
> > > +		return 0;
> > > +
> > > +	for_each_online_cpu(i)
> > > +		if (cpu_data(i).phys_proc_id == cpu_data(cpu).phys_proc_id)
> > > +			return cpu_data(i).loops_per_jiffy;
> > 
> > Hm, why do we have to make such an assumption? Cannot we query the 
> > core frequency?
> 
> >> See V2 of the patch. The above assumption was removed & replaced by a check for
> >> X86_FEATURE_CONSTANT_TSC & using the TSC for __delay(). If all cores see a
> >> constant TSC frequency, then core frequency should not matter.
> >> 
> >> Does this make sense....
> 
> 
> Ahhh..  I see what you mean. I failed to update the comment in the code.
> Aside from the bogus comment (I'll send a V3 with a fixed comment), does the patch
> look ok.

Well, it still uses heuristics: it assumes frequency is the same when 
the cpuid data tells us that two CPUs are on the same socket, right?

Cannot we directly see the frequency(ies) of the CPU, and decide 
based on that whether the calibration result can be cached?

Thanks,

	Ingo

  reply	other threads:[~2011-08-05 21:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 13:57 [PATCH] x86: Reduce clock calibration time during slave cpu startup Jack Steiner
2011-07-27 14:05 ` Dave Jones
     [not found]   ` <20110727141527.GA8453@sgi.com>
     [not found]     ` <20110727155200.GA25381@redhat.com>
2011-08-01 18:45       ` [PATCH v2] " Jack Steiner
2011-08-05 10:46         ` Ingo Molnar
2011-08-05 13:13           ` Jack Steiner
2011-08-05 13:16           ` Jack Steiner
2011-08-05 21:38             ` Ingo Molnar [this message]
2011-08-07  0:36               ` Matthew Garrett
2011-08-08 20:44                 ` Jack Steiner
2011-08-09 15:06                 ` Ingo Molnar
2011-08-09 15:18                   ` Matthew Garrett
2011-08-11 20:14                     ` [PATCH v3] " Jack Steiner
2011-08-06  0:21             ` [PATCH v2] " Yinghai Lu
2011-08-06  6:58               ` Ingo Molnar
2011-08-06 10:51               ` Robin Holt
2011-08-06 14:39               ` Jack Steiner
2011-08-26 23:56 ` [PATCH] " Andrew Morton
2011-08-26 23:57   ` Andrew Morton
2011-08-29 15:04   ` Jack Steiner

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=20110805213836.GB21114@elte.hu \
    --to=mingo@elte.hu \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steiner@sgi.com \
    --cc=tglx@linutronix.de \
    --cc=yinghan@google.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 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.