From: Nadav Amit <nadav.amit@gmail.com>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>,
Will Deacon <will@kernel.org>,
"Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Nick Piggin <npiggin@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Mayuresh Chitale <mchitale@ventanamicro.com>,
Vincent Chen <vincent.chen@sifive.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-arch@vger.kernel.org, linux-mm <linux-mm@kvack.org>,
linux-riscv@lists.infradead.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Samuel Holland <samuel@sholland.org>,
Lad Prabhakar <prabhakar.csengg@gmail.com>
Subject: Re: [PATCH v6 0/4] riscv: tlb flush improvements
Date: Tue, 7 Nov 2023 10:38:01 +0200 [thread overview]
Message-ID: <D1DBDDD4-9B6A-40EA-993E-FF6CF02A2668@gmail.com> (raw)
In-Reply-To: <mhng-4e3e3fa7-5e25-494c-a3ad-6ef7ec78cf20@palmer-ri-x1c9a>
> On Nov 7, 2023, at 9:00 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> On Mon, 30 Oct 2023 07:01:48 PDT (-0700), nadav.amit@gmail.com wrote:
>>
>>> On Oct 30, 2023, at 3:30 PM, Alexandre Ghiti <alexghiti@rivosinc.com> wrote:
>>> + on_each_cpu_mask(cmask,
>>> + __ipi_flush_tlb_range_asid,
>>> + &ftd, 1);
>>
>> Unrelated, but having fed
>
> Do you mean `ftd`?
>
> If so I'm not all that convinced that's a problem: sure it's 4x`long`, so we pass it on the stack instead of registers, but otherwise we'd need another `on_each_cpu_mask()` callback to shim stuff through via registers.
I have no idea why you need to move stuff through the registers.
>> Actually, it is best not to put it on the stack, if possible to reduce
>> cache traffic.
>
> Sorry if I'm just missing something, but I'm not convinced this is a measurable performance problem.
I am not going to try to convince you (I ran the numbers on x86 a long
time ago).
There is a cost of bouncing cache-lines (because multiple cores access
the stack), TLB-miss on remote cores (which is mostly avoidable if ftd
is global).
Having said that, the optimizations you added now and intend to add in
the next steps are definitely more important for performance.
next prev parent reply other threads:[~2023-11-07 8:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 13:30 Alexandre Ghiti
2023-10-30 13:30 ` [PATCH v6 1/4] riscv: Improve tlb_flush() Alexandre Ghiti
2023-10-30 13:30 ` [PATCH v6 2/4] riscv: Improve flush_tlb_range() for hugetlb pages Alexandre Ghiti
2023-10-30 13:30 ` [PATCH v6 3/4] riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb Alexandre Ghiti
2023-10-30 13:30 ` [PATCH v6 4/4] riscv: Improve flush_tlb_kernel_range() Alexandre Ghiti
2023-10-30 14:01 ` [PATCH v6 0/4] riscv: tlb flush improvements Nadav Amit
2023-11-07 7:00 ` Palmer Dabbelt
2023-11-07 8:38 ` Nadav Amit [this message]
2023-11-07 6:50 ` patchwork-bot+linux-riscv
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=D1DBDDD4-9B6A-40EA-993E-FF6CF02A2668@gmail.com \
--to=nadav.amit@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexghiti@rivosinc.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mchitale@ventanamicro.com \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
--cc=prabhakar.csengg@gmail.com \
--cc=samuel@sholland.org \
--cc=vincent.chen@sifive.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