[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220216170947.GB10784@willie-the-truck>
Date: Wed, 16 Feb 2022 17:09:47 +0000
From: Will Deacon <will@...nel.org>
To: Jisheng Zhang <Jisheng.Zhang@...aptics.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: Add read_mostly declaration/definition to irq
stack ptr
On Mon, Feb 07, 2022 at 04:46:42PM +0800, Jisheng Zhang wrote:
> Add "read-mostly" qualifier to irq_stack_ptr and
> irq_shadow_call_stack_ptr. This is to prevent the false sharing.
>
> Before the patch, I got below percpu layout with one defconfig:
> ffffffc008723050 <mde_ref_count>:
> ffffffc008723050: 00 00 00 00
> ....
>
> ffffffc008723054 <kde_ref_count>:
> ffffffc008723054: 00 00 00 00
> ....
>
> ffffffc008723058 <irq_stack_ptr>:
> ...
>
> ffffffc008723060 <nmi_contexts>:
> ...
>
> ffffffc008723070 <fpsimd_last_state>:
>
> As can be seen, the irq_stack_ptr sits with the heavy read/write percpu
> vars such as fpsimd_last_state etc. at the same cacheline.
>
> After the patch:
>
> ffffffc008723000 <irq_stack_ptr>:
> ...
>
> ffffffc008723008 <cpu_number>:
> ...
>
> ffffffc008723010 <arm64_ssbd_callback_required>:
> ...
>
> ffffffc008723018 <bp_hardening_data>:
> ...
>
> Now, the irq_stack_ptr sits with read mostly percpu vars such as
> cpu_number etc. at the same cacheline.
Were you able to measure any performance difference after this change?
Will
Powered by blists - more mailing lists