Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-14 Thread Uladzislau Rezki
On Mon, Dec 14, 2020 at 03:37:46PM +, Matthew Wilcox wrote: > On Mon, Dec 14, 2020 at 04:11:28PM +0100, Uladzislau Rezki wrote: > > On Sun, Dec 13, 2020 at 09:51:34PM +, Matthew Wilcox wrote: > > > If we need to iterate the list efficiently, i'd suggest getting rid of > > > the list and usi

Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-14 Thread Matthew Wilcox
On Mon, Dec 14, 2020 at 04:11:28PM +0100, Uladzislau Rezki wrote: > On Sun, Dec 13, 2020 at 09:51:34PM +, Matthew Wilcox wrote: > > If we need to iterate the list efficiently, i'd suggest getting rid of > > the list and using an xarray instead. maybe a maple tree, once that code > > is better

Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-14 Thread Uladzislau Rezki
On Sun, Dec 13, 2020 at 09:51:34PM +, Matthew Wilcox wrote: > On Sun, Dec 13, 2020 at 07:39:36PM +0100, Uladzislau Rezki wrote: > > On Sun, Dec 13, 2020 at 01:08:43PM -0500, Waiman Long wrote: > > > When multiple locks are acquired, they should be released in reverse > > > order. For s_start()

Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-14 Thread Waiman Long
On 12/14/20 4:39 AM, David Hildenbrand wrote: On 13.12.20 19:08, Waiman Long wrote: When multiple locks are acquired, they should be released in reverse order. For s_start() and s_stop() in mm/vmalloc.c, that is not the case. s_start: mutex_lock(&vmap_purge_lock); spin_lock(&vmap_area_lock);

Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-14 Thread David Hildenbrand
On 13.12.20 19:08, Waiman Long wrote: > When multiple locks are acquired, they should be released in reverse > order. For s_start() and s_stop() in mm/vmalloc.c, that is not the > case. > > s_start: mutex_lock(&vmap_purge_lock); spin_lock(&vmap_area_lock); > s_stop : mutex_unlock(&vmap_purge_l

Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-13 Thread Matthew Wilcox
On Sun, Dec 13, 2020 at 07:39:36PM +0100, Uladzislau Rezki wrote: > On Sun, Dec 13, 2020 at 01:08:43PM -0500, Waiman Long wrote: > > When multiple locks are acquired, they should be released in reverse > > order. For s_start() and s_stop() in mm/vmalloc.c, that is not the > > case. > > > > s_sta

Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-13 Thread Waiman Long
On 12/13/20 1:39 PM, Uladzislau Rezki wrote: On Sun, Dec 13, 2020 at 01:08:43PM -0500, Waiman Long wrote: When multiple locks are acquired, they should be released in reverse order. For s_start() and s_stop() in mm/vmalloc.c, that is not the case. s_start: mutex_lock(&vmap_purge_lock); spin_

Re: [PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-13 Thread Uladzislau Rezki
On Sun, Dec 13, 2020 at 01:08:43PM -0500, Waiman Long wrote: > When multiple locks are acquired, they should be released in reverse > order. For s_start() and s_stop() in mm/vmalloc.c, that is not the > case. > > s_start: mutex_lock(&vmap_purge_lock); spin_lock(&vmap_area_lock); > s_stop : mut

[PATCH] mm/vmalloc: Fix unlock order in s_stop()

2020-12-13 Thread Waiman Long
When multiple locks are acquired, they should be released in reverse order. For s_start() and s_stop() in mm/vmalloc.c, that is not the case. s_start: mutex_lock(&vmap_purge_lock); spin_lock(&vmap_area_lock); s_stop : mutex_unlock(&vmap_purge_lock); spin_unlock(&vmap_area_lock); This unlock s