linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Roberts <ryan.roberts@arm.com>
To: "Christoph Lameter (Ampere)" <cl@gentwo.org>,
	Catalin Marinas <catalin.marinas@arm.com>
Cc: Yang Shi <shy828301@gmail.com>,
	lsf-pc@lists.linux-foundation.org, Linux MM <linux-mm@kvack.org>,
	dennis@kernel.org, Tejun Heo <tj@kernel.org>,
	urezki@gmail.com, Will Deacon <will@kernel.org>,
	Yang Shi <yang@os.amperecomputing.com>
Subject: Re: [LSF/MM/BPF TOPIC] Improve this_cpu_ops performance for ARM64 (and potentially other architectures)
Date: Wed, 18 Feb 2026 09:18:47 +0000	[thread overview]
Message-ID: <401402d3-fcda-456a-8fb4-800eb918dbc7@arm.com> (raw)
In-Reply-To: <c095a354-5b71-76f5-d7be-536216bf7321@gentwo.org>

On 17/02/2026 17:28, Christoph Lameter (Ampere) wrote:
> On Mon, 16 Feb 2026, Catalin Marinas wrote:
> 
>> It's not about TLB conflicts but rather using the wrong translation for
>> a per-CPU variable with CnP.
> 
> These conflicts could only come about if each PE would not be able to have
> its own page table but share page tables between processors.
> 
> That is not the case from what I can tell. The ARM64 code does not
> support a shared page table and if I remember right Windows actually requires a per
> processor page table.

Each PE is able to be configured to use it's own page table, I'm not denying
that. It is definitely possible to implement what you are proposing.

However, there is a feature called FEAT_TTCNP, which allows SW to hint to the PE
that the entries in it's pgtable are the same as entries in another PE's
pgtable. If the hint (bit 0 in TTBR1) is applied for multiple PEs, then those
PEs are permitted to share a TLB.

Today, if the kernel is compiled with CNP support and the CPU supports it, then
the bit is set.

AIUI, there are a number of CPUs out there that can share TLB to some extent and
do take advantage of this feature.

Your proposed per-CPU pgtable would be incompatible with CNP because if PE0 and
PE1 share a TLB, PE1 would end up miss-translating a per-CPU VA to PE0's copy if
PE0 previously accessed it and caused the (shared) TLB entry to be created.

So I believe there will be a performance cost for some CPUs if we take your
proposed approach and disable CNP. We would need to evaluate that cost and
decide which of the 2 mutually exclusive features provides the most value.

Thanks,
Ryan



      reply	other threads:[~2026-02-18  9:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 23:14 Yang Shi
2026-02-11 23:29 ` Tejun Heo
2026-02-11 23:39   ` Christoph Lameter (Ampere)
2026-02-11 23:40     ` Tejun Heo
2026-02-12  0:05       ` Christoph Lameter (Ampere)
2026-02-11 23:58   ` Yang Shi
2026-02-12 17:54     ` Catalin Marinas
2026-02-12 18:43       ` Catalin Marinas
2026-02-13  0:23         ` Yang Shi
2026-02-12 18:45       ` Ryan Roberts
2026-02-12 19:36         ` Catalin Marinas
2026-02-12 21:12           ` Ryan Roberts
2026-02-16 10:37             ` Catalin Marinas
2026-02-18  8:59               ` Ryan Roberts
2026-02-12 18:41 ` Ryan Roberts
2026-02-12 18:55   ` Christoph Lameter (Ampere)
2026-02-12 18:58     ` Ryan Roberts
2026-02-13 18:42   ` Yang Shi
2026-02-16 11:39     ` Catalin Marinas
2026-02-17 17:28       ` Christoph Lameter (Ampere)
2026-02-18  9:18         ` Ryan Roberts [this message]

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=401402d3-fcda-456a-8fb4-800eb918dbc7@arm.com \
    --to=ryan.roberts@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=cl@gentwo.org \
    --cc=dennis@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=shy828301@gmail.com \
    --cc=tj@kernel.org \
    --cc=urezki@gmail.com \
    --cc=will@kernel.org \
    --cc=yang@os.amperecomputing.com \
    /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