linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: "Christopher S. Hall" <christopher.s.hall@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Richard Cochran <richardcochran@gmail.com>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	"Stanton, Kevin B" <kevin.b.stanton@intel.com>
Subject: Re: [PATCH v6 4/9] Always Running Timer (ART) correlated clocksource
Date: Thu, 14 Jan 2016 14:00:18 -0800	[thread overview]
Message-ID: <CALAqxLXaRwbmPLcWgxuDxY6MaQw_65nDzP_ELZ=5GeHm8cgEBw@mail.gmail.com> (raw)
In-Reply-To: <1452687149-11281-5-git-send-email-christopher.s.hall@intel.com>

On Wed, Jan 13, 2016 at 4:12 AM, Christopher S. Hall
<christopher.s.hall@intel.com> wrote:
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index c7c4d9c..26dcf63 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -949,10 +949,36 @@ static struct notifier_block time_cpufreq_notifier_block = {
>         .notifier_call  = time_cpufreq_notifier
>  };
>
> +#define ART_CPUID_LEAF (0x15)
> +/* The denominator will never be less that 2 */
> +#define ART_MIN_DENOMINATOR (2)
> +
> +static u32 art_to_tsc_numerator;
> +static u32 art_to_tsc_denominator;

This is declared in a #ifdef CONFIG_CPU_FREQ


> @@ -1071,6 +1097,24 @@ int unsynchronized_tsc(void)
>         return 0;
>  }
>
> +/*
> + * Convert ART to TSC given numerator/denominator found in detect_art()
> + */
> +static u64 convert_art_to_tsc(struct correlated_cs *cs, u64 cycles)
> +{
> +       u64 tmp, res;
> +
> +       res = (cycles / art_to_tsc_denominator) * art_to_tsc_numerator;
> +       tmp = (cycles % art_to_tsc_denominator) * art_to_tsc_numerator;
> +       res += tmp / art_to_tsc_denominator;

Then used outside of that block.

So this won't build if CPU_FREQ is disabled.

But don't bother to fix that, as I've already done so and I've got a
bunch of tweaks I'm making to the code (I figured I'd done enough
nit-picking reviews, and probably should just roll my sleeves up and
take a swing at how I'd prefer the code look - including Richard's
suggestions as well).

I'll send you my revisions here shortly and hopefully you can let me
know if anything goes too far and hopefully do some testing with it.

thanks
-john

  reply	other threads:[~2016-01-14 22:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 12:12 [PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 1/9] Add cycles to nanoseconds translation Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 2/9] Add driver cross timestamp interface for higher precision time synchronization Christopher S. Hall
2016-01-13 21:30   ` Richard Cochran
2016-01-13 12:12 ` [PATCH v6 3/9] Add correlated clocksource relating aliased auxiliary and system clocks Christopher S. Hall
2016-01-15  0:24   ` John Stultz
2016-01-15 10:29     ` Thomas Gleixner
2016-01-13 12:12 ` [PATCH v6 4/9] Always Running Timer (ART) correlated clocksource Christopher S. Hall
2016-01-14 22:00   ` John Stultz [this message]
2016-01-13 12:12 ` [PATCH v6 5/9] Add timekeeping snapshot code capturing system time and counter Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 6/9] Add history to cross timestamp interface supporting slower devices Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 7/9] Remove duplicated code in ktime_get_raw_and_real() Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 8/9] Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping Christopher S. Hall
2016-01-13 21:31   ` Richard Cochran
2016-01-13 12:12 ` [PATCH v6 9/9] Adds hardware supported cross timestamp Christopher S. Hall
2016-01-15  0:49 ` [PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms John Stultz

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='CALAqxLXaRwbmPLcWgxuDxY6MaQw_65nDzP_ELZ=5GeHm8cgEBw@mail.gmail.com' \
    --to=john.stultz@linaro.org \
    --cc=christopher.s.hall@intel.com \
    --cc=hpa@zytor.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=kevin.b.stanton@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --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 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).