linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang@os.amperecomputing.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Yang Shi <shy828301@gmail.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>,
	lsf-pc@lists.linux-foundation.org, Linux MM <linux-mm@kvack.org>,
	"Christoph Lameter (Ampere)" <cl@gentwo.org>,
	dennis@kernel.org, Tejun Heo <tj@kernel.org>,
	urezki@gmail.com, Will Deacon <will@kernel.org>
Subject: Re: [LSF/MM/BPF TOPIC] Improve this_cpu_ops performance for ARM64 (and potentially other architectures)
Date: Thu, 26 Feb 2026 10:31:46 -0800	[thread overview]
Message-ID: <011671c7-6eaa-4389-a058-dd1ba133d8bd@os.amperecomputing.com> (raw)
In-Reply-To: <aZMCAWiA7XHYLIE1@arm.com>



On 2/16/26 3:39 AM, Catalin Marinas wrote:
> On Fri, Feb 13, 2026 at 10:42:21AM -0800, Yang Shi wrote:
>> On Thu, Feb 12, 2026 at 10:42 AM Ryan Roberts <ryan.roberts@arm.com> wrote:
>>> On 11/02/2026 23:14, Yang Shi wrote:
>>>> So, the code flow should just become:
>>>> INC VIRTUAL_BASE + percpu_variable_offset
>>>>
>>>> In order to do that we need to have the same virtual address mapped
>>>> differently for each processor. This means we need different page
>>>> tables for each processor. These page tables
>>>> can map almost all of the address space in the same way. The only area
>>>> that will be special is the area starting at VIRTUAL_BASE.
>>> This is an interesting idea. I'm keen to be involved in discussions.
>>>
>>> My immediate concern is that this would not be compatible with FEAT_TTCNP, which
>>> allows multiple PEs (ARM speak for CPU) to share a TLB - e.g. for SMT. I'm not
>>> sure if that would be the end of the world; the perf numbers below are
>>> compelling. I'll defer to others' opions on that.
>> Thank you for involving the discussion. The concern is definitely
>> valid. The shared TLB sounds like a microarchitecture feature or
>> design choice. AmpereOne supports CNP, but doesn't share TLB. As long
>> as it doesn't generate TLB conflict abort, shared TLB should be fine,
>> but may suffer from frequent TLB invalidation. Anyway I think it
>> should be solvable. We can make percpu page table opt-in if the
>> machines can handle TLB conflict, just like what we did for
>> bbml2_noabort.
> It's not about TLB conflicts but rather using the wrong translation for
> a per-CPU variable with CnP.

Ah, yes. It may be just a simple TLB hit for the other CPU due to the 
same virtual address is used if TLB is shared.




  parent reply	other threads:[~2026-02-26 18:31 UTC|newest]

Thread overview: 25+ 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-24 16:47       ` Christoph Lameter (Ampere)
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
2026-02-26 18:31       ` Yang Shi [this message]
2026-02-23  9:50 ` Heiko Carstens
2026-02-26 17:48   ` Yang Shi

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=011671c7-6eaa-4389-a058-dd1ba133d8bd@os.amperecomputing.com \
    --to=yang@os.amperecomputing.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=ryan.roberts@arm.com \
    --cc=shy828301@gmail.com \
    --cc=tj@kernel.org \
    --cc=urezki@gmail.com \
    --cc=will@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