Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-09 Thread Uladzislau Rezki
Hello, Daniel. On Wed, Oct 09, 2019 at 08:05:39AM +0200, Daniel Wagner wrote: > On Tue, Oct 08, 2019 at 06:04:59PM +0200, Uladzislau Rezki wrote: > > > so, we do not guarantee, instead we minimize number of allocations > > > with GFP_NOWAIT flag. For example on my 4xCPUs i am not able to > > >

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-09 Thread Daniel Wagner
On Tue, Oct 08, 2019 at 06:04:59PM +0200, Uladzislau Rezki wrote: > > so, we do not guarantee, instead we minimize number of allocations > > with GFP_NOWAIT flag. For example on my 4xCPUs i am not able to > > even trigger the case when CPU is not preloaded. > > > > I can test it tomorrow on my

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-08 Thread Uladzislau Rezki
On Mon, Oct 07, 2019 at 11:44:20PM +0200, Uladzislau Rezki wrote: > On Mon, Oct 07, 2019 at 07:36:44PM +0200, Sebastian Andrzej Siewior wrote: > > On 2019-10-07 18:56:11 [+0200], Uladzislau Rezki wrote: > > > Actually there is a high lock contention on vmap_area_lock, because it > > > is still

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Uladzislau Rezki
On Mon, Oct 07, 2019 at 07:36:44PM +0200, Sebastian Andrzej Siewior wrote: > On 2019-10-07 18:56:11 [+0200], Uladzislau Rezki wrote: > > Actually there is a high lock contention on vmap_area_lock, because it > > is still global. You can have a look at last slide: > > > >

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Sebastian Andrzej Siewior
On 2019-10-07 18:56:11 [+0200], Uladzislau Rezki wrote: > Actually there is a high lock contention on vmap_area_lock, because it > is still global. You can have a look at last slide: > >

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Daniel Wagner
On Mon, Oct 07, 2019 at 06:56:11PM +0200, Uladzislau Rezki wrote: > On Mon, Oct 07, 2019 at 06:34:43PM +0200, Daniel Wagner wrote: > > I supppose, one thing which would help in this discussion, is what do > > you gain by using preempt_disable() instead of moving the lock up? > > Do you have

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Uladzislau Rezki
On Mon, Oct 07, 2019 at 06:34:43PM +0200, Daniel Wagner wrote: > On Mon, Oct 07, 2019 at 06:23:30PM +0200, Uladzislau Rezki wrote: > > Hello, Daniel, Sebastian. > > > > > > On Fri, Oct 04, 2019 at 06:30:42PM +0200, Sebastian Andrzej Siewior > > > > wrote: > > > > > On 2019-10-04 18:20:41

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Daniel Wagner
On Mon, Oct 07, 2019 at 06:23:30PM +0200, Uladzislau Rezki wrote: > Hello, Daniel, Sebastian. > > > > On Fri, Oct 04, 2019 at 06:30:42PM +0200, Sebastian Andrzej Siewior wrote: > > > > On 2019-10-04 18:20:41 [+0200], Uladzislau Rezki wrote: > > > > > If we have migrate_disable/enable, then, i

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Uladzislau Rezki
Hello, Daniel, Sebastian. > > On Fri, Oct 04, 2019 at 06:30:42PM +0200, Sebastian Andrzej Siewior wrote: > > > On 2019-10-04 18:20:41 [+0200], Uladzislau Rezki wrote: > > > > If we have migrate_disable/enable, then, i think preempt_enable/disable > > > > should be replaced by it and not the way

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Sebastian Andrzej Siewior
On 2019-10-07 10:30:37 [+0200], Daniel Wagner wrote: > Hi, Hi Daniel, > On Fri, Oct 04, 2019 at 06:30:42PM +0200, Sebastian Andrzej Siewior wrote: > > On 2019-10-04 18:20:41 [+0200], Uladzislau Rezki wrote: > > > If we have migrate_disable/enable, then, i think preempt_enable/disable > > > should

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Daniel Wagner
Hi, On Fri, Oct 04, 2019 at 06:30:42PM +0200, Sebastian Andrzej Siewior wrote: > On 2019-10-04 18:20:41 [+0200], Uladzislau Rezki wrote: > > If we have migrate_disable/enable, then, i think preempt_enable/disable > > should be replaced by it and not the way how it has been proposed > > in the

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-07 Thread Daniel Wagner
On Fri, Oct 04, 2019 at 05:37:28PM +0200, Sebastian Andrzej Siewior wrote: > If you post something that is related to PREEMPT_RT please keep tglx and > me in Cc. Sure, just forgot to add it this time. My email setup needs a bit more love. Sorry.

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-04 Thread Sebastian Andrzej Siewior
On 2019-10-04 19:04:11 [+0200], Uladzislau Rezki wrote: > if another, we can free the object allocated on previous step if > it already has it. If another CPU does not have it, save it in > ne_fit_preload_node for another current CPU to reuse later. Further > we can not migrate because of: > >

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-04 Thread Uladzislau Rezki
> > You could have been migrated to another CPU while > memory has been allocated. > That is true that we can migrate since we allow preemption when allocate. But it does not really matter on which CPU an allocation occurs and whether we migrate or not. If we land on another CPU or still stay on

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-04 Thread Sebastian Andrzej Siewior
On 2019-10-04 18:20:41 [+0200], Uladzislau Rezki wrote: > On Fri, Oct 04, 2019 at 05:37:28PM +0200, Sebastian Andrzej Siewior wrote: > > If you post something that is related to PREEMPT_RT please keep tglx and > > me in Cc. > > > > On 2019-10-03 11:09:06 [+0200], Daniel Wagner wrote: > > >

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-04 Thread Uladzislau Rezki
On Fri, Oct 04, 2019 at 05:37:28PM +0200, Sebastian Andrzej Siewior wrote: > If you post something that is related to PREEMPT_RT please keep tglx and > me in Cc. > > On 2019-10-03 11:09:06 [+0200], Daniel Wagner wrote: > > Replace preempt_enable() and preempt_disable() with the vmap_area_lock > >

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-04 Thread Sebastian Andrzej Siewior
If you post something that is related to PREEMPT_RT please keep tglx and me in Cc. On 2019-10-03 11:09:06 [+0200], Daniel Wagner wrote: > Replace preempt_enable() and preempt_disable() with the vmap_area_lock > spin_lock instead. Calling spin_lock() with preempt disabled is > illegal for -rt.

Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-03 Thread Uladzislau Rezki
On Thu, Oct 03, 2019 at 11:09:06AM +0200, Daniel Wagner wrote: > Replace preempt_enable() and preempt_disable() with the vmap_area_lock > spin_lock instead. Calling spin_lock() with preempt disabled is > illegal for -rt. Furthermore, enabling preemption inside the > spin_lock() doesn't really make

[PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node

2019-10-03 Thread Daniel Wagner
Replace preempt_enable() and preempt_disable() with the vmap_area_lock spin_lock instead. Calling spin_lock() with preempt disabled is illegal for -rt. Furthermore, enabling preemption inside the spin_lock() doesn't really make sense. Fixes: 82dd23e84be3 ("mm/vmalloc.c: preload a CPU with one