linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Christoph Lameter (Ampere)" <cl@gentwo.org>
To: Yunhui Cui <cuiyunhui@bytedance.com>
Cc: punit.agrawal@bytedance.com, paul.walmsley@sifive.com,
	palmer@dabbelt.com,  aou@eecs.berkeley.edu, dennis@kernel.org,
	tj@kernel.org,  samitolvanen@google.com, guoren@kernel.org,
	debug@rivosinc.com,  charlie@rivosinc.com, cleger@rivosinc.com,
	puranjay@kernel.org,  antonb@tenstorrent.com, namcaov@gmail.com,
	andy.chiu@sifive.com,  ajones@ventanamicro.com,
	samuel.holland@sifive.com, haxel@fzi.de,
	 yang.zhang@hexintek.com, conor.dooley@microchip.com,
	evan@rivosinc.com,  yang.lee@linux.alibaba.com,
	tglx@linutronix.de, haibo1.xu@intel.com,
	 linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	 linux-mm@kvack.org
Subject: Re: [PATCH RFC] riscv: use gp to save percpu offset
Date: Fri, 23 Aug 2024 18:57:43 -0700 (PDT)	[thread overview]
Message-ID: <e06a3bd9-6378-2d4b-b06d-cc2d58776eca@gentwo.org> (raw)
In-Reply-To: <20240824004920.35877-1-cuiyunhui@bytedance.com>

On Sat, 24 Aug 2024, Yunhui Cui wrote:

> Compared to directly fetching the per-CPU offset from memory (or cache),
> using the global pointer (gp) to store the per-CPU offset can save one
> memory access.

Yes! That is a step in the right direction.

Is there something like gp relative addressing so that we can do loads
and stores relative to gp as well?

Are there atomics that can do read modify write relative to GP? That would
get  you to comparable per cpu efficiency to x86. x86 can do relative
addressing and RMV in one instruction which allows one to drop the preempt
enable/disable since one instruction cannot be interrupted.


  reply	other threads:[~2024-08-24  2:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-24  0:49 Yunhui Cui
2024-08-24  1:57 ` Christoph Lameter (Ampere) [this message]
2024-08-30 10:01   ` [External] " yunhui cui

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=e06a3bd9-6378-2d4b-b06d-cc2d58776eca@gentwo.org \
    --to=cl@gentwo.org \
    --cc=ajones@ventanamicro.com \
    --cc=andy.chiu@sifive.com \
    --cc=antonb@tenstorrent.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=charlie@rivosinc.com \
    --cc=cleger@rivosinc.com \
    --cc=conor.dooley@microchip.com \
    --cc=cuiyunhui@bytedance.com \
    --cc=debug@rivosinc.com \
    --cc=dennis@kernel.org \
    --cc=evan@rivosinc.com \
    --cc=guoren@kernel.org \
    --cc=haibo1.xu@intel.com \
    --cc=haxel@fzi.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=namcaov@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=punit.agrawal@bytedance.com \
    --cc=puranjay@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=samuel.holland@sifive.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=yang.lee@linux.alibaba.com \
    --cc=yang.zhang@hexintek.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