Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-29 Thread John Hubbard
On 3/28/19 7:25 PM, Jerome Glisse wrote: [...] >> The input value is not the problem. The problem is in the naming. >> >> obj = get_obj( various parameters ); >> put_obj(obj); >> >> >> The problem is that the function is named hmm_register() either "gets" a >> reference to _or_ creates and gets a

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 11:21:00AM -0700, Ira Weiny wrote: > On Thu, Mar 28, 2019 at 09:50:03PM -0400, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 06:18:35PM -0700, John Hubbard wrote: > > > On 3/28/19 6:00 PM, Jerome Glisse wrote: > > > > On Thu, Mar 28, 2019 at 09:57:09AM -0700, Ira Weiny

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Ira Weiny
On Thu, Mar 28, 2019 at 09:50:03PM -0400, Jerome Glisse wrote: > On Thu, Mar 28, 2019 at 06:18:35PM -0700, John Hubbard wrote: > > On 3/28/19 6:00 PM, Jerome Glisse wrote: > > > On Thu, Mar 28, 2019 at 09:57:09AM -0700, Ira Weiny wrote: > > >> On Thu, Mar 28, 2019 at 05:39:26PM -0700, John Hubbard

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 07:11:17PM -0700, John Hubbard wrote: > On 3/28/19 6:50 PM, Jerome Glisse wrote: > [...] > >>> > >>> The hmm_put() is just releasing the reference on the hmm struct. > >>> > >>> Here i feel i am getting contradicting requirement from different people. > >>> I don't think

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread John Hubbard
On 3/28/19 6:50 PM, Jerome Glisse wrote: [...] >>> >>> The hmm_put() is just releasing the reference on the hmm struct. >>> >>> Here i feel i am getting contradicting requirement from different people. >>> I don't think there is a way to please everyone here. >>> >> >> That's not a true conflict:

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 06:18:35PM -0700, John Hubbard wrote: > On 3/28/19 6:00 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 09:57:09AM -0700, Ira Weiny wrote: > >> On Thu, Mar 28, 2019 at 05:39:26PM -0700, John Hubbard wrote: > >>> On 3/28/19 2:21 PM, Jerome Glisse wrote: > On Thu,

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread John Hubbard
On 3/28/19 6:00 PM, Jerome Glisse wrote: > On Thu, Mar 28, 2019 at 09:57:09AM -0700, Ira Weiny wrote: >> On Thu, Mar 28, 2019 at 05:39:26PM -0700, John Hubbard wrote: >>> On 3/28/19 2:21 PM, Jerome Glisse wrote: On Thu, Mar 28, 2019 at 01:43:13PM -0700, John Hubbard wrote: > On 3/28/19

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 09:57:09AM -0700, Ira Weiny wrote: > On Thu, Mar 28, 2019 at 05:39:26PM -0700, John Hubbard wrote: > > On 3/28/19 2:21 PM, Jerome Glisse wrote: > > > On Thu, Mar 28, 2019 at 01:43:13PM -0700, John Hubbard wrote: > > >> On 3/28/19 12:11 PM, Jerome Glisse wrote: > > >>> On

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Ira Weiny
On Thu, Mar 28, 2019 at 05:39:26PM -0700, John Hubbard wrote: > On 3/28/19 2:21 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 01:43:13PM -0700, John Hubbard wrote: > >> On 3/28/19 12:11 PM, Jerome Glisse wrote: > >>> On Thu, Mar 28, 2019 at 04:07:20AM -0700, Ira Weiny wrote: > On Mon,

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread John Hubbard
On 3/28/19 2:21 PM, Jerome Glisse wrote: > On Thu, Mar 28, 2019 at 01:43:13PM -0700, John Hubbard wrote: >> On 3/28/19 12:11 PM, Jerome Glisse wrote: >>> On Thu, Mar 28, 2019 at 04:07:20AM -0700, Ira Weiny wrote: On Mon, Mar 25, 2019 at 10:40:02AM -0400, Jerome Glisse wrote: > From:

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 01:43:13PM -0700, John Hubbard wrote: > On 3/28/19 12:11 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 04:07:20AM -0700, Ira Weiny wrote: > >> On Mon, Mar 25, 2019 at 10:40:02AM -0400, Jerome Glisse wrote: > >>> From: Jérôme Glisse > >>> > >>> Every time i read the

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread John Hubbard
On 3/28/19 12:11 PM, Jerome Glisse wrote: > On Thu, Mar 28, 2019 at 04:07:20AM -0700, Ira Weiny wrote: >> On Mon, Mar 25, 2019 at 10:40:02AM -0400, Jerome Glisse wrote: >>> From: Jérôme Glisse >>> >>> Every time i read the code to check that the HMM structure does not >>> vanish before it should

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 04:07:20AM -0700, Ira Weiny wrote: > On Mon, Mar 25, 2019 at 10:40:02AM -0400, Jerome Glisse wrote: > > From: Jérôme Glisse > > > > Every time i read the code to check that the HMM structure does not > > vanish before it should thanks to the many lock protecting its

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Ira Weiny
On Mon, Mar 25, 2019 at 10:40:02AM -0400, Jerome Glisse wrote: > From: Jérôme Glisse > > Every time i read the code to check that the HMM structure does not > vanish before it should thanks to the many lock protecting its removal > i get a headache. Switch to reference counting instead it is

[PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-25 Thread jglisse
From: Jérôme Glisse Every time i read the code to check that the HMM structure does not vanish before it should thanks to the many lock protecting its removal i get a headache. Switch to reference counting instead it is much easier to follow and harder to break. This also remove some code that