[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mvma7c4kyo4.fsf@linux-m68k.org>
Date: Tue, 20 Aug 2019 10:51:07 +0200
From: Andreas Schwab <schwab@...ux-m68k.org>
To: Atish Patra <Atish.Patra@....com>
Cc: "linux-riscv\@lists.infradead.org" <linux-riscv@...ts.infradead.org>,
"paul.walmsley\@sifive.com" <paul.walmsley@...ive.com>,
"aou\@eecs.berkeley.edu" <aou@...s.berkeley.edu>,
"allison\@lohutok.net" <allison@...utok.net>,
"anup\@brainfault.org" <anup@...infault.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
"hch\@infradead.org" <hch@...radead.org>,
"palmer\@sifive.com" <palmer@...ive.com>
Subject: Re: [v2 PATCH] RISC-V: Optimize tlb flush path.
On Aug 20 2019, Atish Patra <Atish.Patra@....com> wrote:
> +
> + cpuid = get_cpu();
> + if (!cmask) {
> + riscv_cpuid_to_hartid_mask(cpu_online_mask, &hmask);
> + goto issue_sfence;
> + }
> +
> +
> + if (cpumask_test_cpu(cpuid, cmask) && cpumask_weight(cmask) ==
> 1) {
> + /* Save trap cost by issuing a local tlb flush here */
> + if ((start == 0 && size == -1) || (size > PAGE_SIZE))
> + local_flush_tlb_all();
> + else if (size == PAGE_SIZE)
> + local_flush_tlb_page(start);
> + goto done;
> + }
> +
> riscv_cpuid_to_hartid_mask(cmask, &hmask);
> +
> +issue_sfence:
> sbi_remote_sfence_vma(hmask.bits, start, size);
> +done:
> + put_cpu();
> }
>
> This is much simpler than what I had done in v2. I will address the if
> condition around size as well.
I still think that this function should be moved out of the header.
Andreas.
--
Andreas Schwab, schwab@...ux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Powered by blists - more mailing lists