public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Waiman Long <Waiman.Long@hpe.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	Borislav Petkov <bp@suse.de>, Andy Lutomirski <luto@kernel.org>,
	Prarit Bhargava <prarit@redhat.com>,
	Scott J Norton <scott.norton@hpe.com>,
	Douglas Hatch <doug.hatch@hpe.com>,
	Randy Wright <rwright@hpe.com>
Subject: Re: [PATCH v5] x86/hpet: Reduce HPET counter read contention
Date: Fri, 12 Aug 2016 14:44:10 -0700	[thread overview]
Message-ID: <57AE432A.9010201@intel.com> (raw)
In-Reply-To: <1471037130-60583-1-git-send-email-Waiman.Long@hpe.com>

On 08/12/2016 02:25 PM, Waiman Long wrote:
> +	do {
> +		cpu_relax();
> +		new.lockval = READ_ONCE(hpet.lockval);
> +	} while ((new.value == old.value) && raw_spin_is_locked(&new.lock));

While it gets more far-fetched, this isn't guaranteed to make progress
until the saved HPET value actually changes.  You could have a constant
stream of other CPUs going and doing hpet_readl() (and getting the same
value back from a sloooow HPET).  So each time through this loop, this
processor sees (new.value == old.value), and sees the lock held.

  parent reply	other threads:[~2016-08-12 21:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 21:25 [PATCH v5] x86/hpet: Reduce HPET counter read contention Waiman Long
2016-08-12 21:38 ` Dave Hansen
2016-08-12 22:50   ` Waiman Long
2016-08-12 21:44 ` Dave Hansen [this message]
2016-08-12 22:58   ` 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=57AE432A.9010201@intel.com \
    --to=dave.hansen@intel.com \
    --cc=Waiman.Long@hpe.com \
    --cc=bp@suse.de \
    --cc=doug.hatch@hpe.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=prarit@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox