All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Waiman Long <Waiman.Long@hpe.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Jiang Liu <jiang.liu@linux.intel.com>,
	Borislav Petkov <bp@suse.de>, Andy Lutomirski <luto@kernel.org>,
	Scott J Norton <scott.norton@hpe.com>,
	Douglas Hatch <doug.hatch@hpe.com>,
	Randy Wright <rwright@hpe.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH v4] x86/hpet: Reduce HPET counter read contention
Date: Wed, 13 Apr 2016 08:18:13 +0200	[thread overview]
Message-ID: <20160413061813.GB4705@gmail.com> (raw)
In-Reply-To: <1460486768-34024-1-git-send-email-Waiman.Long@hpe.com>


* Waiman Long <Waiman.Long@hpe.com> wrote:

> On a large system with many CPUs, using HPET as the clock source can
> have a significant impact on the overall system performance because
> of the following reasons:
>  1) There is a single HPET counter shared by all the CPUs.
>  2) HPET counter reading is a very slow operation.
> 
> Using HPET as the default clock source may happen when, for example,
> the TSC clock calibration exceeds the allowable tolerance. Something
> the performance slowdown can be so severe that the system may crash
> because of a NMI watchdog soft lockup, for example.

>  /*
> + * Reading the HPET counter is a very slow operation. If a large number of
> + * CPUs are trying to access the HPET counter simultaneously, it can cause
> + * massive delay and slow down system performance dramatically. This may
> + * happen when HPET is the default clock source instead of TSC. For a
> + * really large system with hundreds of CPUs, the slowdown may be so
> + * severe that it may actually crash the system because of a NMI watchdog
> + * soft lockup, for example.
> + *
> + * If multiple CPUs are trying to access the HPET counter at the same time,
> + * we don't actually need to read the counter multiple times. Instead, the
> + * other CPUs can use the counter value read by the first CPU in the group.

Hm, weird, so how can this:

  static cycle_t read_hpet(struct clocksource *cs)
  {
         return (cycle_t)hpet_readl(HPET_COUNTER);
  }

... cause an actual slowdown of that magnitude? This goes straight to MMIO. So is 
the hardware so terminally broken?

How good is the TSC clocksource on the affected system? Could we simply always use 
the TSC (and not use the HPET at all as a clocksource), instead of trying to fix 
broken hardware?

Thanks,

	Ingo

  reply	other threads:[~2016-04-13  6:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 18:46 [PATCH v4] x86/hpet: Reduce HPET counter read contention Waiman Long
2016-04-13  6:18 ` Ingo Molnar [this message]
2016-04-13 15:37   ` Waiman Long
2016-04-14  0:25     ` Peter Zijlstra
2016-04-14  2:10       ` Waiman Long
2016-05-12 23:20 ` Waiman Long

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=20160413061813.GB4705@gmail.com \
    --to=mingo@kernel.org \
    --cc=Waiman.Long@hpe.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=bp@suse.de \
    --cc=doug.hatch@hpe.com \
    --cc=hpa@zytor.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rwright@hpe.com \
    --cc=scott.norton@hpe.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 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.