Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > Objects can be freed and reused and still be accessed from code that > > thinks the object is the old and not the new object > > Yes, I know, that's the point of RCU typesafety. My point is that an > object *which has never been used* can't be

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > Objects can be freed and reused and still be accessed from code that > > thinks the object is the old and not the new object > > Yes, I know, that's the point of RCU typesafety. My point is that an > object *which has never been used* can't be

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 12:45:56PM -0500, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > > How do you envision dealing with the SLAB_TYPESAFE_BY_RCU slab caches? > > > Those must have a defined state of the objects at all times and a > > > constructor is > > >

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 12:45:56PM -0500, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > > How do you envision dealing with the SLAB_TYPESAFE_BY_RCU slab caches? > > > Those must have a defined state of the objects at all times and a > > > constructor is > > >

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > How do you envision dealing with the SLAB_TYPESAFE_BY_RCU slab caches? > > Those must have a defined state of the objects at all times and a > > constructor is > > required for that. And their use of RCU is required for numerous lockless > > lookup

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > How do you envision dealing with the SLAB_TYPESAFE_BY_RCU slab caches? > > Those must have a defined state of the objects at all times and a > > constructor is > > required for that. And their use of RCU is required for numerous lockless > > lookup

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 12:30:23PM -0500, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > If we want to get rid of the concept of constructors, it's doable, > > but somebody needs to do the work to show what the effects will be. > > How do you envision dealing with

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 12:30:23PM -0500, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > If we want to get rid of the concept of constructors, it's doable, > > but somebody needs to do the work to show what the effects will be. > > How do you envision dealing with

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > If we want to get rid of the concept of constructors, it's doable, > but somebody needs to do the work to show what the effects will be. How do you envision dealing with the SLAB_TYPESAFE_BY_RCU slab caches? Those must have a defined state of the

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > If we want to get rid of the concept of constructors, it's doable, > but somebody needs to do the work to show what the effects will be. How do you envision dealing with the SLAB_TYPESAFE_BY_RCU slab caches? Those must have a defined state of the

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > Are you willing to have this kind of bug go uncaught for a while? There will be frequent allocations and this will show up at some point. Also you could put this into the debug only portions somehwere so we always catch it when debugging is on, '

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > Are you willing to have this kind of bug go uncaught for a while? There will be frequent allocations and this will show up at some point. Also you could put this into the debug only portions somehwere so we always catch it when debugging is on, '

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 06:53:04AM -0700, Eric Dumazet wrote: > On 04/10/2018 05:53 AM, Matthew Wilcox wrote: > > From: Matthew Wilcox > > > > __GFP_ZERO requests that the object be initialised to all-zeroes, > > while the purpose of a constructor is to initialise an

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 06:53:04AM -0700, Eric Dumazet wrote: > On 04/10/2018 05:53 AM, Matthew Wilcox wrote: > > From: Matthew Wilcox > > > > __GFP_ZERO requests that the object be initialised to all-zeroes, > > while the purpose of a constructor is to initialise an object to a > > particular

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 09:21:20AM -0500, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > __GFP_ZERO requests that the object be initialised to all-zeroes, > > while the purpose of a constructor is to initialise an object to a > > particular pattern. We cannot do

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
On Tue, Apr 10, 2018 at 09:21:20AM -0500, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > __GFP_ZERO requests that the object be initialised to all-zeroes, > > while the purpose of a constructor is to initialise an object to a > > particular pattern. We cannot do

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > __GFP_ZERO requests that the object be initialised to all-zeroes, > > while the purpose of a constructor is to initialise an object to a > > particular pattern. We cannot do both. Add a warning to

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > __GFP_ZERO requests that the object be initialised to all-zeroes, > > while the purpose of a constructor is to initialise an object to a > > particular pattern. We cannot do both. Add a warning to

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to catch any > users who mistakenly pass a __GFP_ZERO flag

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Christopher Lameter
On Tue, 10 Apr 2018, Matthew Wilcox wrote: > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to catch any > users who mistakenly pass a __GFP_ZERO flag

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Eric Dumazet
On 04/10/2018 05:53 AM, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Eric Dumazet
On 04/10/2018 05:53 AM, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to catch any > users who

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Vlastimil Babka
On 04/10/2018 02:53 PM, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Vlastimil Babka
On 04/10/2018 02:53 PM, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to catch any > users who

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 05:53:50, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Michal Hocko
On Tue 10-04-18 05:53:50, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to catch any > users who

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Johannes Weiner
On Tue, Apr 10, 2018 at 05:53:50AM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add

Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Johannes Weiner
On Tue, Apr 10, 2018 at 05:53:50AM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to catch any

[PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
From: Matthew Wilcox __GFP_ZERO requests that the object be initialised to all-zeroes, while the purpose of a constructor is to initialise an object to a particular pattern. We cannot do both. Add a warning to catch any users who mistakenly pass a __GFP_ZERO flag when

[PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor

2018-04-10 Thread Matthew Wilcox
From: Matthew Wilcox __GFP_ZERO requests that the object be initialised to all-zeroes, while the purpose of a constructor is to initialise an object to a particular pattern. We cannot do both. Add a warning to catch any users who mistakenly pass a __GFP_ZERO flag when allocating a slab with a