All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vacek <neelx@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] tsc: make calibration refinement more robust
Date: Mon, 5 Nov 2018 16:41:56 +0100	[thread overview]
Message-ID: <CACjP9X-1ZJhGuNLNXBvvzcffWqpxFRUDmc4jsRuvTE2s4hxtJw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1811020922240.1642@nanos.tec.linutronix.de>

On Sat, Nov 3, 2018 at 11:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> Daniel,
>
> On Fri, 2 Nov 2018, Daniel Vacek wrote:
>> On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> >> -#define MAX_RETRIES     5
>> >> -#define SMI_TRESHOLD    50000
>> >> +#define MAX_RETRIES  5
>> >> +#define TSC_THRESHOLD        (tsc_khz >> 5)
>> >
>> > This breaks pit_hpet_ptimer_calibrate_cpu() because at that point tsc_hkz is 0.
>>
>> That did not show up with my testing, sorry. I guess
>> pit_calibrate_tsc() never failed for me. Hmm, actually it looks like
>> quick_pit_calibrate() does the job for me so
>> pit_hpet_ptimer_calibrate_cpu() is likely not even called.
>
> Right. It's only called when quick calibration fails. Testing does not
> replace code inspection :)

Agreed. I was not 100% sure about this early init and order of
execution as it's dynamically changed with x86_platform.calibrate_cpu
and x86_platform.calibrate_tsc. Thanks again for the review, Thomas.

> Can you please avoid hiding the logic in a macro? Just use a local
> variable:
>
>         u64 thresh = tsc_khz ? tsc_khz >> 5 : TSC_DEFAULT_THRESHOLD;
>
> and use that in the comparison.

Sweet, I'll do that :)

--nX

> Thanks,
>
>         tglx

  reply	other threads:[~2018-11-05 15:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 15:12 [PATCH] tsc: make calibration refinement more robust Daniel Vacek
2018-11-01 15:34 ` Thomas Gleixner
2018-11-02  6:40   ` Daniel Vacek
2018-11-03 10:04     ` Thomas Gleixner
2018-11-05 15:41       ` Daniel Vacek [this message]
2018-11-05 17:10 ` [PATCH v2] x86/tsc: " Daniel Vacek
2018-11-06 20:57   ` [tip:x86/timers] x86/tsc: Make " tip-bot for Daniel Vacek
2019-01-08 13:14     ` Daniel Vacek
2019-01-11 20:45       ` Thomas Gleixner
2019-01-16 15:53         ` Daniel Vacek
2019-01-28 16:00           ` Thomas Gleixner

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=CACjP9X-1ZJhGuNLNXBvvzcffWqpxFRUDmc4jsRuvTE2s4hxtJw@mail.gmail.com \
    --to=neelx@redhat.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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 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.