Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Gargi Sharma
On Mon, Oct 2, 2017 at 8:52 PM, Rik van Riel wrote: > On Mon, 2017-10-02 at 17:21 +0200, Oleg Nesterov wrote: >> Hi Rik, >> >> On 10/02, Rik van Riel wrote: >> > >> > Gargi and I are looking at that code, and trying to figure out >> > exactly what needs to be done to make all of

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Gargi Sharma
On Mon, Oct 2, 2017 at 8:52 PM, Rik van Riel wrote: > On Mon, 2017-10-02 at 17:21 +0200, Oleg Nesterov wrote: >> Hi Rik, >> >> On 10/02, Rik van Riel wrote: >> > >> > Gargi and I are looking at that code, and trying to figure out >> > exactly what needs to be done to make all of this correct. >>

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Rik van Riel
On Mon, 2017-10-02 at 17:21 +0200, Oleg Nesterov wrote: > Hi Rik, > > On 10/02, Rik van Riel wrote: > > > > Gargi and I are looking at that code, and trying to figure out > > exactly what needs to be done to make all of this correct. > > see another email I sent to Gargi a minute ago, > > > 2)

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Rik van Riel
On Mon, 2017-10-02 at 17:21 +0200, Oleg Nesterov wrote: > Hi Rik, > > On 10/02, Rik van Riel wrote: > > > > Gargi and I are looking at that code, and trying to figure out > > exactly what needs to be done to make all of this correct. > > see another email I sent to Gargi a minute ago, > > > 2)

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Oleg Nesterov
Hi Rik, On 10/02, Rik van Riel wrote: > > Gargi and I are looking at that code, and trying to figure out > exactly what needs to be done to make all of this correct. see another email I sent to Gargi a minute ago, > 2) With pid_ns_prepare_proc out of the way, we can put all the code >from

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Oleg Nesterov
Hi Rik, On 10/02, Rik van Riel wrote: > > Gargi and I are looking at that code, and trying to figure out > exactly what needs to be done to make all of this correct. see another email I sent to Gargi a minute ago, > 2) With pid_ns_prepare_proc out of the way, we can put all the code >from

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Oleg Nesterov
On 09/30, Gargi Sharma wrote: > > On Wed, Sep 27, 2017 at 9:58 PM, Oleg Nesterov wrote: > > If I was not clear... > > > > in short, after this patch the very first idr_alloc_cyclic() is already > > wrong. Because, once again, the new not-fully-initialized pid can be found > > by

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Oleg Nesterov
On 09/30, Gargi Sharma wrote: > > On Wed, Sep 27, 2017 at 9:58 PM, Oleg Nesterov wrote: > > If I was not clear... > > > > in short, after this patch the very first idr_alloc_cyclic() is already > > wrong. Because, once again, the new not-fully-initialized pid can be found > > by find_pid_ns(). >

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Rik van Riel
On Mon, 2017-10-02 at 09:35 -0400, Rik van Riel wrote: > On Wed, 2017-09-27 at 17:45 +0200, Oleg Nesterov wrote: > > On 09/27, Gargi Sharma wrote: > > > > > > -#define find_next_offset(map, off) > > > > > > \ > > > - find_next_zero_bit((map)->page,

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Rik van Riel
On Mon, 2017-10-02 at 09:35 -0400, Rik van Riel wrote: > On Wed, 2017-09-27 at 17:45 +0200, Oleg Nesterov wrote: > > On 09/27, Gargi Sharma wrote: > > > > > > -#define find_next_offset(map, off) > > > > > > \ > > > - find_next_zero_bit((map)->page,

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Rik van Riel
On Wed, 2017-09-27 at 17:45 +0200, Oleg Nesterov wrote: > On 09/27, Gargi Sharma wrote: > > > > -#define find_next_offset(map, off) > > \ > > - find_next_zero_bit((map)->page, BITS_PER_PAGE, > > off) > > - > > this should go into the previous patch, but

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-10-02 Thread Rik van Riel
On Wed, 2017-09-27 at 17:45 +0200, Oleg Nesterov wrote: > On 09/27, Gargi Sharma wrote: > > > > -#define find_next_offset(map, off) > > \ > > - find_next_zero_bit((map)->page, BITS_PER_PAGE, > > off) > > - > > this should go into the previous patch, but

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-09-30 Thread Gargi Sharma
On Wed, Sep 27, 2017 at 9:58 PM, Oleg Nesterov wrote: > If I was not clear... > > in short, after this patch the very first idr_alloc_cyclic() is already > wrong. Because, once again, the new not-fully-initialized pid can be found > by find_pid_ns(). If the PIDNS_ADDING check

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-09-30 Thread Gargi Sharma
On Wed, Sep 27, 2017 at 9:58 PM, Oleg Nesterov wrote: > If I was not clear... > > in short, after this patch the very first idr_alloc_cyclic() is already > wrong. Because, once again, the new not-fully-initialized pid can be found > by find_pid_ns(). If the PIDNS_ADDING check fails, I jump to

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-09-27 Thread Oleg Nesterov
If I was not clear... in short, after this patch the very first idr_alloc_cyclic() is already wrong. Because, once again, the new not-fully-initialized pid can be found by find_pid_ns(). perhaps you should chane the previous patch to do idr_alloc_cyclic(ptr = NULL) and use idr_replace() in this

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-09-27 Thread Oleg Nesterov
If I was not clear... in short, after this patch the very first idr_alloc_cyclic() is already wrong. Because, once again, the new not-fully-initialized pid can be found by find_pid_ns(). perhaps you should chane the previous patch to do idr_alloc_cyclic(ptr = NULL) and use idr_replace() in this

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-09-27 Thread Oleg Nesterov
On 09/27, Gargi Sharma wrote: > > -#define find_next_offset(map, off) \ > - find_next_zero_bit((map)->page, BITS_PER_PAGE, off) > - this should go into the previous patch, but this is minor... > @@ -208,12 +200,10 @@ struct pid *alloc_pid(struct

Re: [PATCH v2 2/2] pid: Remove pidhash

2017-09-27 Thread Oleg Nesterov
On 09/27, Gargi Sharma wrote: > > -#define find_next_offset(map, off) \ > - find_next_zero_bit((map)->page, BITS_PER_PAGE, off) > - this should go into the previous patch, but this is minor... > @@ -208,12 +200,10 @@ struct pid *alloc_pid(struct

[PATCH v2 2/2] pid: Remove pidhash

2017-09-26 Thread Gargi Sharma
pidhash is no longer required as all the information can be looked up from idr tree. nr_hashed represented the number of pids that had been hashed. Since, nr_hashed and PIDNS_HASH_ADDING are no longer relevant, it has been renamed to pid_allocated and PIDNS_ADDING respectively. Signed-off-by:

[PATCH v2 2/2] pid: Remove pidhash

2017-09-26 Thread Gargi Sharma
pidhash is no longer required as all the information can be looked up from idr tree. nr_hashed represented the number of pids that had been hashed. Since, nr_hashed and PIDNS_HASH_ADDING are no longer relevant, it has been renamed to pid_allocated and PIDNS_ADDING respectively. Signed-off-by: