Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Tue, Aug 20, 2019 at 06:59:39PM -0700, Matthew Wilcox wrote: >On Wed, Aug 21, 2019 at 09:22:44AM +0800, Wei Yang wrote: >> On Tue, Aug 20, 2019 at 05:54:17PM -0700, Matthew Wilcox wrote: >> >On Wed, Aug 21, 2019 at 08:52:34AM +0800, Wei Yang wrote: >> >> On Tue, Aug 20, 2019 at 10:26:29AM -0700, Matthew Wilcox wrote: >> >> >On Wed, Aug 14, 2019 at 11:19:37AM +0200, Vlastimil Babka wrote: >> >> >> On 8/14/19 8:57 AM, Wei Yang wrote: >> >> >> > On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: >> >> >> >>Btw, is there any good reason we don't use a list_head for vma >> >> >> >>linkage? >> >> >> > >> >> >> > Not sure, maybe there is some historical reason? >> >> >> >> >> >> Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make >> >> >> the vma >> >> >> list be doubly linked") and I guess it was just simpler to add the >> >> >> vm_prev link. >> >> >> >> >> >> Conversion to list_head might be an interesting project for some >> >> >> "advanced >> >> >> beginner" in the kernel :) >> >> > >> >> >I'm working to get rid of vm_prev and vm_next, so it would probably be >> >> >wasted effort. >> >> >> >> You mean replace it with list_head? >> > >> >No, replace the rbtree with a new tree. https://lwn.net/Articles/787629/ >> >> Sounds interesting. >> >> While I am not sure the plan is settled down, and how long it would take to >> replace the rb_tree with maple tree. I guess it would probably take some time >> to get merged upstream. >> >> IMHO, it would be good to have this cleanup in current kernel. Do you agree? > >The three cleanups you've posted are fine. Doing more work (ie the >list_head) seems like wasted effort to me. Ah, got your point. I misunderstand it. -- Wei Yang Help you, Help me
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Wed, Aug 21, 2019 at 09:22:44AM +0800, Wei Yang wrote: > On Tue, Aug 20, 2019 at 05:54:17PM -0700, Matthew Wilcox wrote: > >On Wed, Aug 21, 2019 at 08:52:34AM +0800, Wei Yang wrote: > >> On Tue, Aug 20, 2019 at 10:26:29AM -0700, Matthew Wilcox wrote: > >> >On Wed, Aug 14, 2019 at 11:19:37AM +0200, Vlastimil Babka wrote: > >> >> On 8/14/19 8:57 AM, Wei Yang wrote: > >> >> > On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: > >> >> >>Btw, is there any good reason we don't use a list_head for vma > >> >> >>linkage? > >> >> > > >> >> > Not sure, maybe there is some historical reason? > >> >> > >> >> Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make > >> >> the vma > >> >> list be doubly linked") and I guess it was just simpler to add the > >> >> vm_prev link. > >> >> > >> >> Conversion to list_head might be an interesting project for some > >> >> "advanced > >> >> beginner" in the kernel :) > >> > > >> >I'm working to get rid of vm_prev and vm_next, so it would probably be > >> >wasted effort. > >> > >> You mean replace it with list_head? > > > >No, replace the rbtree with a new tree. https://lwn.net/Articles/787629/ > > Sounds interesting. > > While I am not sure the plan is settled down, and how long it would take to > replace the rb_tree with maple tree. I guess it would probably take some time > to get merged upstream. > > IMHO, it would be good to have this cleanup in current kernel. Do you agree? The three cleanups you've posted are fine. Doing more work (ie the list_head) seems like wasted effort to me.
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Tue, Aug 20, 2019 at 05:54:17PM -0700, Matthew Wilcox wrote: >On Wed, Aug 21, 2019 at 08:52:34AM +0800, Wei Yang wrote: >> On Tue, Aug 20, 2019 at 10:26:29AM -0700, Matthew Wilcox wrote: >> >On Wed, Aug 14, 2019 at 11:19:37AM +0200, Vlastimil Babka wrote: >> >> On 8/14/19 8:57 AM, Wei Yang wrote: >> >> > On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: >> >> >>Btw, is there any good reason we don't use a list_head for vma linkage? >> >> > >> >> > Not sure, maybe there is some historical reason? >> >> >> >> Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make the >> >> vma >> >> list be doubly linked") and I guess it was just simpler to add the >> >> vm_prev link. >> >> >> >> Conversion to list_head might be an interesting project for some "advanced >> >> beginner" in the kernel :) >> > >> >I'm working to get rid of vm_prev and vm_next, so it would probably be >> >wasted effort. >> >> You mean replace it with list_head? > >No, replace the rbtree with a new tree. https://lwn.net/Articles/787629/ Sounds interesting. While I am not sure the plan is settled down, and how long it would take to replace the rb_tree with maple tree. I guess it would probably take some time to get merged upstream. IMHO, it would be good to have this cleanup in current kernel. Do you agree? -- Wei Yang Help you, Help me
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Wed, Aug 21, 2019 at 08:52:34AM +0800, Wei Yang wrote: > On Tue, Aug 20, 2019 at 10:26:29AM -0700, Matthew Wilcox wrote: > >On Wed, Aug 14, 2019 at 11:19:37AM +0200, Vlastimil Babka wrote: > >> On 8/14/19 8:57 AM, Wei Yang wrote: > >> > On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: > >> >>Btw, is there any good reason we don't use a list_head for vma linkage? > >> > > >> > Not sure, maybe there is some historical reason? > >> > >> Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make the > >> vma > >> list be doubly linked") and I guess it was just simpler to add the vm_prev > >> link. > >> > >> Conversion to list_head might be an interesting project for some "advanced > >> beginner" in the kernel :) > > > >I'm working to get rid of vm_prev and vm_next, so it would probably be > >wasted effort. > > You mean replace it with list_head? No, replace the rbtree with a new tree. https://lwn.net/Articles/787629/
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Tue, Aug 20, 2019 at 10:26:29AM -0700, Matthew Wilcox wrote: >On Wed, Aug 14, 2019 at 11:19:37AM +0200, Vlastimil Babka wrote: >> On 8/14/19 8:57 AM, Wei Yang wrote: >> > On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: >> >>Btw, is there any good reason we don't use a list_head for vma linkage? >> > >> > Not sure, maybe there is some historical reason? >> >> Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make the vma >> list be doubly linked") and I guess it was just simpler to add the vm_prev >> link. >> >> Conversion to list_head might be an interesting project for some "advanced >> beginner" in the kernel :) > >I'm working to get rid of vm_prev and vm_next, so it would probably be >wasted effort. You mean replace it with list_head? -- Wei Yang Help you, Help me
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Wed, Aug 14, 2019 at 11:19:37AM +0200, Vlastimil Babka wrote: > On 8/14/19 8:57 AM, Wei Yang wrote: > > On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: > >>Btw, is there any good reason we don't use a list_head for vma linkage? > > > > Not sure, maybe there is some historical reason? > > Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make the vma > list be doubly linked") and I guess it was just simpler to add the vm_prev > link. > > Conversion to list_head might be an interesting project for some "advanced > beginner" in the kernel :) I'm working to get rid of vm_prev and vm_next, so it would probably be wasted effort.
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Wed, Aug 14, 2019 at 11:19:37AM +0200, Vlastimil Babka wrote: >On 8/14/19 8:57 AM, Wei Yang wrote: >> On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: >>>Btw, is there any good reason we don't use a list_head for vma linkage? >> >> Not sure, maybe there is some historical reason? > >Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make the vma >list be doubly linked") and I guess it was just simpler to add the vm_prev >link. > >Conversion to list_head might be an interesting project for some "advanced >beginner" in the kernel :) Seems it will touch many code ... -- Wei Yang Help you, Help me
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On 8/14/19 8:57 AM, Wei Yang wrote: > On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: >>Btw, is there any good reason we don't use a list_head for vma linkage? > > Not sure, maybe there is some historical reason? Seems it was single-linked until 2010 commit 297c5eee3724 ("mm: make the vma list be doubly linked") and I guess it was just simpler to add the vm_prev link. Conversion to list_head might be an interesting project for some "advanced beginner" in the kernel :)
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
On Tue, Aug 13, 2019 at 10:16:11PM -0700, Christoph Hellwig wrote: >Btw, is there any good reason we don't use a list_head for vma linkage? Not sure, maybe there is some historical reason? -- Wei Yang Help you, Help me
Re: [PATCH 3/3] mm/mmap.c: extract __vma_unlink_list as counter part for __vma_link_list
Btw, is there any good reason we don't use a list_head for vma linkage?