Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-08 Thread Wei Yang
On Thu, Aug 08, 2019 at 10:49:29AM +0200, Vlastimil Babka wrote: >On 8/8/19 5:26 AM, Wei Yang wrote: >> >> @@ -2270,12 +2270,9 @@ find_vma_prev(struct mm_struct *mm, unsigned long >> addr, >> if (vma) { >> *pprev = vma->vm_prev; >> } else { >> -

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-08 Thread Vlastimil Babka
On 8/8/19 5:26 AM, Wei Yang wrote: > > @@ -2270,12 +2270,9 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr, > if (vma) { > *pprev = vma->vm_prev; > } else { > - struct rb_node *rb_node = mm->mm_rb.rb_node; > - *pprev = NULL; >

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-08 Thread Wei Yang
On Thu, Aug 08, 2019 at 08:02:10AM +0200, Michal Hocko wrote: >On Thu 08-08-19 11:26:38, Wei Yang wrote: >> On Wed, Aug 07, 2019 at 09:51:01AM +0200, Michal Hocko wrote: >> >On Wed 07-08-19 08:31:09, Wei Yang wrote: >> >> On Tue, Aug 06, 2019 at 11:29:52AM +0200, Vlastimil Babka wrote: >> >> >On

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-08 Thread Michal Hocko
On Thu 08-08-19 11:26:38, Wei Yang wrote: > On Wed, Aug 07, 2019 at 09:51:01AM +0200, Michal Hocko wrote: > >On Wed 07-08-19 08:31:09, Wei Yang wrote: > >> On Tue, Aug 06, 2019 at 11:29:52AM +0200, Vlastimil Babka wrote: > >> >On 8/6/19 10:11 AM, Wei Yang wrote: > >> >> When addr is out of the

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-07 Thread Wei Yang
On Wed, Aug 07, 2019 at 09:51:01AM +0200, Michal Hocko wrote: >On Wed 07-08-19 08:31:09, Wei Yang wrote: >> On Tue, Aug 06, 2019 at 11:29:52AM +0200, Vlastimil Babka wrote: >> >On 8/6/19 10:11 AM, Wei Yang wrote: >> >> When addr is out of the range of the whole rb_tree, pprev will points to >> >>

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-07 Thread Michal Hocko
On Wed 07-08-19 08:31:09, Wei Yang wrote: > On Tue, Aug 06, 2019 at 11:29:52AM +0200, Vlastimil Babka wrote: > >On 8/6/19 10:11 AM, Wei Yang wrote: > >> When addr is out of the range of the whole rb_tree, pprev will points to > >> the biggest node. find_vma_prev gets is by going through the right

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-06 Thread Wei Yang
On Tue, Aug 06, 2019 at 10:58:22AM +, Balbir Singh wrote: >On Tue, Aug 06, 2019 at 04:11:23PM +0800, Wei Yang wrote: >> When addr is out of the range of the whole rb_tree, pprev will points to >> the biggest node. find_vma_prev gets is by going through the right most >> node of the tree. >>

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-06 Thread Wei Yang
On Tue, Aug 06, 2019 at 11:29:52AM +0200, Vlastimil Babka wrote: >On 8/6/19 10:11 AM, Wei Yang wrote: >> When addr is out of the range of the whole rb_tree, pprev will points to >> the biggest node. find_vma_prev gets is by going through the right most > >s/biggest/last/ ? or right-most? > >> node

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-06 Thread Balbir Singh
On Tue, Aug 06, 2019 at 04:11:23PM +0800, Wei Yang wrote: > When addr is out of the range of the whole rb_tree, pprev will points to > the biggest node. find_vma_prev gets is by going through the right most > node of the tree. > > Since only the last node is the one it is looking for, it is not >

Re: [PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-06 Thread Vlastimil Babka
On 8/6/19 10:11 AM, Wei Yang wrote: > When addr is out of the range of the whole rb_tree, pprev will points to > the biggest node. find_vma_prev gets is by going through the right most s/biggest/last/ ? or right-most? > node of the tree. > > Since only the last node is the one it is looking

[PATCH] mm/mmap.c: refine data locality of find_vma_prev

2019-08-06 Thread Wei Yang
When addr is out of the range of the whole rb_tree, pprev will points to the biggest node. find_vma_prev gets is by going through the right most node of the tree. Since only the last node is the one it is looking for, it is not necessary to assign pprev to those middle stage nodes. By assigning