Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-19 Thread Atish Patra
On Mon, 2019-08-19 at 08:10 -0700, h...@infradead.org wrote: > On Mon, Aug 19, 2019 at 08:39:02PM +0530, Anup Patel wrote: > > If we were using ASID then yes we don't need to flush anything > > but currently we don't use ASID due to lack of HW support and > > HW can certainly do speculatively page

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-19 Thread h...@infradead.org
On Mon, Aug 19, 2019 at 08:39:02PM +0530, Anup Patel wrote: > If we were using ASID then yes we don't need to flush anything > but currently we don't use ASID due to lack of HW support and > HW can certainly do speculatively page table walks so flushing > local TLB when MM mask is empty might

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-19 Thread Anup Patel
On Mon, Aug 19, 2019 at 8:16 PM h...@infradead.org wrote: > > On Thu, Aug 15, 2019 at 08:37:04PM +, Atish Patra wrote: > > We get ton of them. Here is the stack dump. > > Looks like we might not need to flush anything at all here as the > mm_struct was never scheduled to run on any cpu? If

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-19 Thread h...@infradead.org
On Thu, Aug 15, 2019 at 08:37:04PM +, Atish Patra wrote: > We get ton of them. Here is the stack dump. Looks like we might not need to flush anything at all here as the mm_struct was never scheduled to run on any cpu?

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-15 Thread Atish Patra
On Tue, 2019-08-13 at 07:30 -0700, h...@infradead.org wrote: > On Tue, Aug 13, 2019 at 12:15:15AM +, 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

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-13 Thread Atish Patra
On Tue, 2019-08-13 at 11:25 -0700, Paul Walmsley wrote: > Hi Atish, > > On Fri, 9 Aug 2019, Atish Patra wrote: > > > In RISC-V, tlb flush happens via SBI which is expensive. > > If the target cpumask contains a local hartid, some cost > > can be saved by issuing a local tlb flush as we do that >

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-13 Thread Paul Walmsley
Hi Atish, On Fri, 9 Aug 2019, Atish Patra wrote: > In RISC-V, tlb flush happens via SBI which is expensive. > If the target cpumask contains a local hartid, some cost > can be saved by issuing a local tlb flush as we do that > in OpenSBI anyways. > > Signed-off-by: Atish Patra A few brief

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-13 Thread h...@infradead.org
On Tue, Aug 13, 2019 at 12:15:15AM +, 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

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-12 Thread Atish Patra
On Mon, 2019-08-12 at 07:56 -0700, Christoph Hellwig wrote: > I agree with the comment that we really should move this out of line > now, and sure. > also that we can simplify it further, which also includes > not bothering with the SBI call if we were the only online CPU. I already had that

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-12 Thread Christoph Hellwig
On Mon, Aug 12, 2019 at 10:36:25AM -0500, Troy Benjegerdes wrote: > Is there anything other than convention and current usage that prevents > the kernel from natively handling TLB flushes without ever making the SBI > call? Yes and no. In all existing RISC-V implementation remote TLB flushes are

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-12 Thread Atish Patra
On Mon, 2019-08-12 at 10:36 -0500, Troy Benjegerdes wrote: > > On Aug 9, 2019, at 8:43 PM, Atish Patra > > wrote: > > > > In RISC-V, tlb flush happens via SBI which is expensive. > > If the target cpumask contains a local hartid, some cost > > can be saved by issuing a local tlb flush as we do

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-12 Thread Troy Benjegerdes
> On Aug 9, 2019, at 8:43 PM, Atish Patra wrote: > > In RISC-V, tlb flush happens via SBI which is expensive. > If the target cpumask contains a local hartid, some cost > can be saved by issuing a local tlb flush as we do that > in OpenSBI anyways. Is there anything other than convention and

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-12 Thread Christoph Hellwig
I agree with the comment that we really should move this out of line now, and also that we can simplify it further, which also includes not bothering with the SBI call if we were the only online CPU. I also thing we need to use get_cpu/put_cpu to be preemption safe. Also why would we need to do a

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-10 Thread Atish Patra
On 8/9/19, 6:43 PM, "Atish Patra" wrote: In RISC-V, tlb flush happens via SBI which is expensive. If the target cpumask contains a local hartid, some cost can be saved by issuing a local tlb flush as we do that in OpenSBI anyways. Signed-off-by: Atish Patra ---

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-10 Thread Andreas Schwab
On Aug 09 2019, Atish Patra wrote: > @@ -46,14 +47,38 @@ static inline void remote_sfence_vma(struct cpumask > *cmask, unsigned long start, >unsigned long size) > { > struct cpumask hmask; > + struct cpumask tmask; > + int cpuid =

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-09 Thread Atish Patra
On 8/9/19, 8:30 PM, "Anup Patel" wrote: On Sat, Aug 10, 2019 at 7:13 AM Atish Patra wrote: > > In RISC-V, tlb flush happens via SBI which is expensive. > If the target cpumask contains a local hartid, some cost > can be saved by issuing a local tlb flush as we do that

Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-09 Thread Anup Patel
On Sat, Aug 10, 2019 at 7:13 AM Atish Patra wrote: > > In RISC-V, tlb flush happens via SBI which is expensive. > If the target cpumask contains a local hartid, some cost > can be saved by issuing a local tlb flush as we do that > in OpenSBI anyways. > > Signed-off-by: Atish Patra > --- >