[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f1b82a9-a88b-50f5-8b49-69e52d7bdaa9@gentwo.de>
Date: Sun, 30 Oct 2022 14:19:22 +0100 (CET)
From: Christoph Lameter <cl@...two.de>
To: Wen Yao <haiwenyao@...ontech.com>
cc: paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, dennis@...nel.org, tj@...nel.org,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH 1/2] riscv: percpu:Add riscv percpu operations
On Wed, 26 Oct 2022, Wen Yao wrote:
> This patch use riscv AMO(Atomic Memory Operation) instructions to
> optimise some this_cpu_and this_cpu_or this_cpu_add operations.
> It reuse cmpxchg_local() to impletment this_cpu_cmpxchg macros.
> It reuse xchg_relaxed() to impletment this_cpu_xchg macros.
Are you sure that these changes gives you any benefit vs disabling preempt
or irq offs? I dont know too much about atomics on riscv but it looks like
you are using full atomics. The performance penalty for the use of those
is usually drastic. Often irq/preempt off is better.
Could you run some of the synthetic tests to establish the benefit? F.e.
run the synthetic tests for the slub allcator with and without these
patches.
> + __asm__ __volatile__( \
> + "amo" #asm_op ".w" \
amo = atomic operation?
Powered by blists - more mailing lists