Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-31 Thread Peter Zijlstra
On Tue, Jul 31, 2018 at 11:03:03AM -0400, Rik van Riel wrote: > On Tue, 2018-07-31 at 07:29 -0700, Andy Lutomirski wrote: > > > On Jul 31, 2018, at 2:12 AM, Peter Zijlstra > > > wrote: > > > > > > > On Mon, Jul 30, 2018 at 09:05:55PM -0400, Rik van Riel wrote: > > > > > On Mon, 2018-07-30 at 18:2

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-31 Thread Rik van Riel
On Tue, 2018-07-31 at 07:29 -0700, Andy Lutomirski wrote: > > On Jul 31, 2018, at 2:12 AM, Peter Zijlstra > > wrote: > > > > > On Mon, Jul 30, 2018 at 09:05:55PM -0400, Rik van Riel wrote: > > > > On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: > > > > > > > > So for ARCH_NO_ACTIVE_MM w

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-31 Thread Andy Lutomirski
> On Jul 31, 2018, at 2:12 AM, Peter Zijlstra wrote: > >> On Mon, Jul 30, 2018 at 09:05:55PM -0400, Rik van Riel wrote: >>> On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: >>> >>> So for ARCH_NO_ACTIVE_MM we never touch ->active_mm and therefore >>> ->active_mm == ->mm. >> >> Close,

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-31 Thread Peter Zijlstra
On Mon, Jul 30, 2018 at 09:05:55PM -0400, Rik van Riel wrote: > On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: > > > > So for ARCH_NO_ACTIVE_MM we never touch ->active_mm and therefore > > ->active_mm == ->mm. > > Close, but not true for kernel threads, which have a > NULL ->mm, but a

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Rik van Riel
On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: > > So for ARCH_NO_ACTIVE_MM we never touch ->active_mm and therefore > ->active_mm == ->mm. Close, but not true for kernel threads, which have a NULL ->mm, but a non-null ->active_mm that gets passed to enter_lazy_tlb(). I stuck to the s

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Andy Lutomirski
> On Jul 30, 2018, at 2:46 PM, Rik van Riel wrote: > >> On Mon, 2018-07-30 at 12:49 -0700, Andy Lutomirski wrote: >> >> >> I think it's a big step in the right direction, but it still makes be >> nervous. I'd be more comfortable with it if you at least had a >> functional set of patches tha

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Rik van Riel
On Mon, 2018-07-30 at 12:49 -0700, Andy Lutomirski wrote: > > I think it's a big step in the right direction, but it still makes be > nervous. I'd be more comfortable with it if you at least had a > functional set of patches that result in active_mm being gone, > because > that will mean that yo

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Andy Lutomirski
On Mon, Jul 30, 2018 at 12:36 PM, Rik van Riel wrote: > On Mon, 2018-07-30 at 12:30 -0700, Andy Lutomirski wrote: >> On Mon, Jul 30, 2018 at 12:15 PM, Rik van Riel >> wrote: >> > On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: >> > > On Mon, Jul 30, 2018 at 10:30:11AM -0400, Rik van Riel

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Rik van Riel
On Mon, 2018-07-30 at 12:30 -0700, Andy Lutomirski wrote: > On Mon, Jul 30, 2018 at 12:15 PM, Rik van Riel > wrote: > > On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: > > > On Mon, Jul 30, 2018 at 10:30:11AM -0400, Rik van Riel wrote: > > > > > > > > What happened to the rework I did th

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Andy Lutomirski
On Mon, Jul 30, 2018 at 12:15 PM, Rik van Riel wrote: > On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: >> On Mon, Jul 30, 2018 at 10:30:11AM -0400, Rik van Riel wrote: >> >> > > What happened to the rework I did there? That not only avoided >> > > fiddling >> > > with active_mm, but also

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Rik van Riel
On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: > On Mon, Jul 30, 2018 at 10:30:11AM -0400, Rik van Riel wrote: > > > > What happened to the rework I did there? That not only avoided > > > fiddling > > > with active_mm, but also avoids grab/drop cycles for the other > > > architectures wh

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Peter Zijlstra
On Mon, Jul 30, 2018 at 10:30:11AM -0400, Rik van Riel wrote: > > What happened to the rework I did there? That not only avoided > > fiddling > > with active_mm, but also avoids grab/drop cycles for the other > > architectures when doing task->kthread->kthread->task things. > > I don't think I sa

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Rik van Riel
On Mon, 2018-07-30 at 11:55 +0200, Peter Zijlstra wrote: > On Sun, Jul 29, 2018 at 03:54:52PM -0400, Rik van Riel wrote: > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index c45de46fdf10..11724c9e88b0 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -2691,7

Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-30 Thread Peter Zijlstra
On Sun, Jul 29, 2018 at 03:54:52PM -0400, Rik van Riel wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index c45de46fdf10..11724c9e88b0 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -2691,7 +2691,7 @@ static struct rq *finish_task_switch(struct task_struct >

[PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting

2018-07-29 Thread Rik van Riel
On Sat, 28 Jul 2018 21:21:17 -0700 Andy Lutomirski wrote: > On Sat, Jul 28, 2018 at 2:53 PM, Rik van Riel wrote: > > Conditionally skip lazy TLB mm refcounting. When an architecture has > > CONFIG_ARCH_NO_ACTIVE_MM_REFCOUNTING enabled, an mm that is used in > > lazy TLB mode anywhere will get sh