[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190813143027.GA31668@infradead.org>
Date: Tue, 13 Aug 2019 07:30:27 -0700
From: "hch@...radead.org" <hch@...radead.org>
To: Atish Patra <Atish.Patra@....com>
Cc: "hch@...radead.org" <hch@...radead.org>,
"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
Anup Patel <Anup.Patel@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"alexios.zavras@...el.com" <alexios.zavras@...el.com>,
"palmer@...ive.com" <palmer@...ive.com>,
"paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"allison@...utok.net" <allison@...utok.net>
Subject: Re: [PATCH] RISC-V: Issue a local tlb flush if possible.
On Tue, Aug 13, 2019 at 12:15:15AM +0000, Atish Patra wrote:
> I thought if it recieves an empty cpumask, then it should at least do a
> local flush is the expected behavior. Are you saying that we should
> just skip all and return ?
How could we ever receive an empty cpu mask? I think it could only
be empty without the current cpu. At least that is my reading of
the callers and a few other implementations.
> > if (!cpumask || cpumask_test_cpu(cpu, cpumask) {
> > if ((start == 0 && size == -1) || size > PAGE_SIZE)
> > local_flush_tlb_all();
> > else if (size == PAGE_SIZE)
> > local_flush_tlb_page(start);
> > cpumask_clear_cpu(cpuid, cpumask);
>
> This will modify the original cpumask which is not correct. clear part
> has to be done on hmask to avoid a copy.
Indeed. But looking at the x86 tlbflush implementation it seems like we
could use cpumask_any_but() to avoid having to modify the passed in
cpumask.
Powered by blists - more mailing lists