Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-26 Thread Oleg Nesterov
On 03/25, Christopher Lameter wrote: > > On Fri, 22 Mar 2019, Matthew Wilcox wrote: > > > Only for SLAB and SLUB. SLOB requires that you pass a pointer to the > > slab cache; it has no way to look up the slab cache from the object. > > Well then we could either fix SLOB to conform to the others

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-26 Thread Oleg Nesterov
Sorry, I am sick and can't work, hopefully I'll return tomorrow. On 03/22, Christopher Lameter wrote: > > On Fri, 22 Mar 2019, Waiman Long wrote: > > > I am looking forward to it. > > There is also alrady rcu being used in these paths. kfree_rcu() would not > be enough? It is an estalished

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-25 Thread Christopher Lameter
On Mon, 25 Mar 2019, Matthew Wilcox wrote: > Options: > > 1. Dispense with this optimisation and always store the size of the > object before the object. I think thats how SLOB handled it at some point in the past. Lets go back to that setup so its compatible with the other allocators?

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-25 Thread Matthew Wilcox
On Mon, Mar 25, 2019 at 02:15:25PM +, Christopher Lameter wrote: > On Fri, 22 Mar 2019, Matthew Wilcox wrote: > > > On Fri, Mar 22, 2019 at 07:39:31PM +, Christopher Lameter wrote: > > > On Fri, 22 Mar 2019, Waiman Long wrote: > > > > > > > > > > > > >> I am looking forward to it. > > > >

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-25 Thread Christopher Lameter
On Fri, 22 Mar 2019, Matthew Wilcox wrote: > On Fri, Mar 22, 2019 at 07:39:31PM +, Christopher Lameter wrote: > > On Fri, 22 Mar 2019, Waiman Long wrote: > > > > > > > > > >> I am looking forward to it. > > > > There is also alrady rcu being used in these paths. kfree_rcu() would > > > > not

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-22 Thread Matthew Wilcox
On Fri, Mar 22, 2019 at 07:39:31PM +, Christopher Lameter wrote: > On Fri, 22 Mar 2019, Waiman Long wrote: > > > > > > >> I am looking forward to it. > > > There is also alrady rcu being used in these paths. kfree_rcu() would not > > > be enough? It is an estalished mechanism that is mature

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-22 Thread Christopher Lameter
On Fri, 22 Mar 2019, Waiman Long wrote: > > > >> I am looking forward to it. > > There is also alrady rcu being used in these paths. kfree_rcu() would not > > be enough? It is an estalished mechanism that is mature and well > > understood. > > > In this case, the memory objects are from kmem

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-22 Thread Waiman Long
On 03/22/2019 01:50 PM, Christopher Lameter wrote: > On Fri, 22 Mar 2019, Waiman Long wrote: > >> I am looking forward to it. > There is also alrady rcu being used in these paths. kfree_rcu() would not > be enough? It is an estalished mechanism that is mature and well > understood. > In this case,

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-22 Thread Christopher Lameter
On Fri, 22 Mar 2019, Waiman Long wrote: > I am looking forward to it. There is also alrady rcu being used in these paths. kfree_rcu() would not be enough? It is an estalished mechanism that is mature and well understood.

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-22 Thread Waiman Long
On 03/22/2019 07:16 AM, Oleg Nesterov wrote: > On 03/21, Matthew Wilcox wrote: >> On Thu, Mar 21, 2019 at 05:45:10PM -0400, Waiman Long wrote: >> >>> To avoid this dire condition and reduce lock hold time of tasklist_lock, >>> flush_sigqueue() is modified to pass in a freeing queue pointer so that

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-22 Thread Oleg Nesterov
On 03/21, Matthew Wilcox wrote: > > On Thu, Mar 21, 2019 at 05:45:10PM -0400, Waiman Long wrote: > > > To avoid this dire condition and reduce lock hold time of tasklist_lock, > > flush_sigqueue() is modified to pass in a freeing queue pointer so that > > the actual freeing of memory objects can

Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-21 Thread Matthew Wilcox
On Thu, Mar 21, 2019 at 05:45:10PM -0400, Waiman Long wrote: > It was found that if a process had many pending signals (e.g. millions), > the act of exiting that process might cause its parent to have a hard > lockup especially on a debug kernel with features like KASAN enabled. > It was because

[PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory

2019-03-21 Thread Waiman Long
It was found that if a process had many pending signals (e.g. millions), the act of exiting that process might cause its parent to have a hard lockup especially on a debug kernel with features like KASAN enabled. It was because the flush_sigqueue() was called in release_task() with tasklist_lock