mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Turner <mattst88@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>,
	 Magnus Lindholm <linmag7@gmail.com>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Matt Turner <mattst88@gmail.com>
Subject: [PATCH 0/2] alpha: Use rpcc as the clocksource on SMP and without WTINT
Date: Sat, 05 Dec 2026 00:33:04 -0500	[thread overview]
Message-ID: <20261205-alpha-rpcc-smp-v1-0-084c39baee43@gmail.com> (raw)

Alpha registers the rpcc clocksource only on uniprocessor machines and
only without CONFIG_ALPHA_WTINT, which most SMP configurations enable.
Every SMP machine other than QEMU therefore runs on the jiffies
clocksource.

Patch 1 makes the WTINT restriction a runtime decision. Not all PALcode
implements WTINT; where it does not, do_entIF() already turns the call
into a no-op, so the counter never stops and rpcc is safe to use. The
Marvel firmware's Tru64 PALcode is one of these.

Patch 2 lifts the uniprocessor restriction by measuring a per-CPU offset
between the CPUs' cycle counters, as proposed for parisc's cr16 [1].
Firmware zeroes each counter separately when the CPU starts and only
PALcode can write it, so the counters cannot be aligned directly.

Tested on an ES47 (Marvel) with two 1.3 GHz EV7s, CONFIG_ALPHA_WTINT=y:

  rpcc: CPU1 offset 607373602 cycles (reference CPU0, round trip 963 cycles)
  clocksource: Switched to clocksource rpcc

Two threads pinned to different CPUs, passing CLOCK_MONOTONIC readings
back and forth, saw no backward step in 3 million round trips, both
right after boot and after 21 minutes.

A draft that remeasured the offsets every minute saw them move by at
most 275 cycles over 20 minutes, with no trend, so the series measures
only once, at boot.

If the parisc patch lands too, the measurement could move into common
code; I'm happy to do that as a follow-up.

[1] https://patch.msgid.link/20261204-parisc-cr16-smp-v2-1-1e37fc62aae2@gmail.com

---
Matt Turner (2):
      alpha: Use rpcc when WTINT is configured but not implemented
      alpha: Synchronize rpcc across CPUs on SMP

 arch/alpha/include/asm/hwrpb.h |   1 +
 arch/alpha/kernel/proto.h      |   1 +
 arch/alpha/kernel/time.c       | 235 ++++++++++++++++++++++++++++++++++++++---
 arch/alpha/kernel/traps.c      |   4 +
 4 files changed, 227 insertions(+), 14 deletions(-)
---
base-commit: 9437ee8b6cf607e883b36e44bd755968daaebd48
change-id: 20261204-alpha-rpcc-smp-5929dd41d2a7

Best regards,
--  
Matt Turner <mattst88@gmail.com>


             reply	other threads:[~2026-12-05  5:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  5:33 Matt Turner [this message]
2026-12-05 20:38 ` [PATCH 1/2] alpha: Use rpcc when WTINT is configured but not implemented Matt Turner
2026-12-05 20:38 ` [PATCH 2/2] alpha: Synchronize rpcc across CPUs on SMP Matt Turner
2026-12-06  0:30   ` Magnus Lindholm
2026-12-06  0:32 ` [PATCH 0/2] alpha: Use rpcc as the clocksource on SMP and without WTINT Magnus Lindholm

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=20261205-alpha-rpcc-smp-v1-0-084c39baee43@gmail.com \
    --to=mattst88@gmail.com \
    --cc=linmag7@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.henderson@linaro.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

all inboxes | Powered by JetHome®