linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang@os.amperecomputing.com>
To: Heiko Carstens <hca@linux.ibm.com>, Yang Shi <shy828301@gmail.com>
Cc: 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, Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Ryan Roberts <ryan.roberts@arm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [LSF/MM/BPF TOPIC] Improve this_cpu_ops performance for ARM64 (and potentially other architectures)
Date: Thu, 26 Feb 2026 09:48:48 -0800	[thread overview]
Message-ID: <84817a7f-9d37-4235-a00c-35df02c21fbf@os.amperecomputing.com> (raw)
In-Reply-To: <20260223095020.8139Bd5-hca@linux.ibm.com>



On 2/23/26 1:50 AM, Heiko Carstens wrote:
> On Wed, Feb 11, 2026 at 03:14:57PM -0800, Yang Shi wrote:
>> Design
>> ======
>> To improve the performance for this_cpu_ops on ARM64 and potentially
>> some other non-x86 architectures, I and Christopher Lameter proposed
>> the below solution.
> ...
>
>> I have done some PoC on ARM64. Hopefully I can post them to the
>> mailing list to ease the discussion before the conference.
> FWIW, from an s390 perspective we have been relying on that preempt_disable()
> and preempt_enable() pairs for this_cpu*() ops are optimized away at compile
> time for PREEMPT_NONE and PREEMPT_VOLUNTARY. Which is what all distributions
> did, until now.
>
> With 7dadeaa6e851 ("sched: Further restrict the preemption modes") this is not
> the case anymore. So the overhead will be there for every "up-to-date"
> architecture except x86. I've been looking at some ways how to get rid of this
> extra overhead for s390. E.g. we have an "access register mode", which can be
> sort of compared to the x86 segment register approach, but switching the CPU
> to this mode and back is more expensive than the preempt_disable() and
> preempt_enable() pairs.

If I read the code correctly, preempt_disable/enable are *NOT* no-op on 
arm64 even though PREEMPT_VOLUNTARY is enabled. I tested with 
CONFIG_PREEMPT (should be called PREEMPT_FULL before), I saw roughly 2% 
more real time improvement on kernel build workload comparing to 
PREEMPT_VOLUNTARY. The improvement for sys time basically stays same.

>
> To make the long story short: I'm very interested in your approch from an s390
> perspective (aka "other non-x86 architectures").

Thanks for showing interest. Hopefully I can cleanup the patches, then 
post them to the mailing list before LSF/MM so that people can test it 
on other architectures, for example, s390. But it may still have a lot 
hack and ad hoc code.

Thanks,
Yang




      reply	other threads:[~2026-02-26 17:49 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
2026-02-23  9:50 ` Heiko Carstens
2026-02-26 17:48   ` Yang Shi [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=84817a7f-9d37-4235-a00c-35df02c21fbf@os.amperecomputing.com \
    --to=yang@os.amperecomputing.com \
    --cc=agordeev@linux.ibm.com \
    --cc=catalin.marinas@arm.com \
    --cc=cl@gentwo.org \
    --cc=dennis@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --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