Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-10 Thread Chen Gang
On 9/11/15 02:19, Oleg Nesterov wrote: > On 09/10, Chen Gang wrote: >> - If "addr>= vm_start", we return this vma (else continue searching). > > This is optimization, we can stop the search because in this case > vma == tmp is obviously the 1st vma with "addr < vm_end". > OK, thanks. I guess

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-10 Thread Oleg Nesterov
On 09/10, Chen Gang wrote: > > On 9/10/15 00:26, Oleg Nesterov wrote: > > > > The implementation looks correct. Why do you think it can be not 1st vma? > > > > It is in while (rb_node) {...}. > > - When we set "vma = tmp", it is alreay match "addr < vm_end". Yes, > - If "addr>= vm_start", we

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-10 Thread Oleg Nesterov
On 09/10, Chen Gang wrote: > > On 9/10/15 00:26, Oleg Nesterov wrote: > > > > The implementation looks correct. Why do you think it can be not 1st vma? > > > > It is in while (rb_node) {...}. > > - When we set "vma = tmp", it is alreay match "addr < vm_end". Yes, > - If "addr>= vm_start", we

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-10 Thread Chen Gang
On 9/11/15 02:19, Oleg Nesterov wrote: > On 09/10, Chen Gang wrote: >> - If "addr>= vm_start", we return this vma (else continue searching). > > This is optimization, we can stop the search because in this case > vma == tmp is obviously the 1st vma with "addr < vm_end". > OK, thanks. I guess

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-09 Thread Chen Gang
On 9/10/15 00:26, Oleg Nesterov wrote: > On 09/08, Chen Gang wrote: >> >> I also want to consult: the comments of find_vma() says: > > Sorry, I don't understand the question ;) > >> "Look up the first VMA which satisfies addr < vm_end, ..." >> >> Is it OK? > > Why not? > We will continue discuss

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-09 Thread Oleg Nesterov
On 09/08, Chen Gang wrote: > > I also want to consult: the comments of find_vma() says: Sorry, I don't understand the question ;) > "Look up the first VMA which satisfies addr < vm_end, ..." > > Is it OK? Why not? > (why not "vm_start <= addr < vm_end"), Because this some callers actually

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-09 Thread Oleg Nesterov
On 09/08, Chen Gang wrote: > > I also want to consult: the comments of find_vma() says: Sorry, I don't understand the question ;) > "Look up the first VMA which satisfies addr < vm_end, ..." > > Is it OK? Why not? > (why not "vm_start <= addr < vm_end"), Because this some callers actually

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-09 Thread Chen Gang
On 9/10/15 00:26, Oleg Nesterov wrote: > On 09/08, Chen Gang wrote: >> >> I also want to consult: the comments of find_vma() says: > > Sorry, I don't understand the question ;) > >> "Look up the first VMA which satisfies addr < vm_end, ..." >> >> Is it OK? > > Why not? > We will continue discuss

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-08 Thread David Rientjes
On Sat, 5 Sep 2015, Chen Gang wrote: > > From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 > From: Chen Gang > Date: Sat, 5 Sep 2015 21:49:56 +0800 > Subject: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in >  find_vma() >

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-08 Thread Chen Gang
On 9/7/15 20:36, Oleg Nesterov wrote: > On 09/05, Chen Gang wrote: >> >> From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 >> From: Chen Gang >> Date: Sat, 5 Sep 2015 21:49:56 +0800 >> Subject: [PATCH] mm/mmap.c: Remove useless stat

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-08 Thread Chen Gang
On 9/7/15 20:36, Oleg Nesterov wrote: > On 09/05, Chen Gang wrote: >> >> From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 >> From: Chen Gang <gang.chen.5...@gmail.com> >> Date: Sat, 5 Sep 2015 21:49:56 +0800 >> Subject: [PATCH] mm/mmap.

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-08 Thread David Rientjes
On Sat, 5 Sep 2015, Chen Gang wrote: > > From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 > From: Chen Gang <gang.chen.5...@gmail.com> > Date: Sat, 5 Sep 2015 21:49:56 +0800 > Subject: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL&quo

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-07 Thread Oleg Nesterov
On 09/05, Chen Gang wrote: > > From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 > From: Chen Gang > Date: Sat, 5 Sep 2015 21:49:56 +0800 > Subject: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in >  find_vma() > > Before the ma

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-07 Thread Oleg Nesterov
On 09/05, Chen Gang wrote: > > From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 > From: Chen Gang <gang.chen.5...@gmail.com> > Date: Sat, 5 Sep 2015 21:49:56 +0800 > Subject: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in >  find

[PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-05 Thread Chen Gang
>From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Sat, 5 Sep 2015 21:49:56 +0800 Subject: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in  find_vma() Before the main looping, vma is already is NULL, so need not set it t

[PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-05 Thread Chen Gang
>From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001 From: Chen Gang <gang.chen.5...@gmail.com> Date: Sat, 5 Sep 2015 21:49:56 +0800 Subject: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in  find_vma() Before the main looping, vma is alrea

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-02 Thread Chen Gang
Hello all: I also want to consult: the comments of find_vma() says: "Look up the first VMA which satisfies addr < vm_end, ..." Is it OK? (why not "vm_start <= addr < vm_end"), need we let "vma = tmp" in "if (tmp->vm_start <= addr)"? -- it looks the comments is not match the implementation,

[PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-02 Thread gang . chen . 5i5j
From: Chen Gang Before the main looping, vma is already is NULL, so need not set it to NULL, again. Signed-off-by: Chen Gang --- mm/mmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index df6d5f0..4db7cf0 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2054,7 +2054,6

[PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-02 Thread gang . chen . 5i5j
From: Chen Gang Before the main looping, vma is already is NULL, so need not set it to NULL, again. Signed-off-by: Chen Gang --- mm/mmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index df6d5f0..4db7cf0 100644

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

2015-09-02 Thread Chen Gang
Hello all: I also want to consult: the comments of find_vma() says: "Look up the first VMA which satisfies addr < vm_end, ..." Is it OK? (why not "vm_start <= addr < vm_end"), need we let "vma = tmp" in "if (tmp->vm_start <= addr)"? -- it looks the comments is not match the implementation,