Re: [PATCHv3 1/3] mm: Introduce vma_init()

2018-07-26 Thread Kirill A. Shutemov
On Wed, Jul 25, 2018 at 07:42:01PM +, Andrew Morton wrote: > On Wed, 25 Jul 2018 15:39:24 +0300 "Kirill A. Shutemov" > wrote: > > > There are few more: > > > > arch/arm64/include/asm/tlb.h: struct vm_area_struct vma = { .vm_mm = > > tlb->mm, }; > > arch/arm64/mm/hugetlbpage.c:struct

Re: [PATCHv3 1/3] mm: Introduce vma_init()

2018-07-25 Thread Andrew Morton
On Wed, 25 Jul 2018 15:39:24 +0300 "Kirill A. Shutemov" wrote: > There are few more: > > arch/arm64/include/asm/tlb.h: struct vm_area_struct vma = { .vm_mm = > tlb->mm, }; > arch/arm64/mm/hugetlbpage.c:struct vm_area_struct vma = { .vm_mm = mm }; > arch/arm64/mm/hugetlbpage.c:struct

Re: [PATCHv3 1/3] mm: Introduce vma_init()

2018-07-25 Thread Linus Torvalds
On Wed, Jul 25, 2018 at 5:39 AM Kirill A. Shutemov wrote: > > There are few more: > > arch/arm64/include/asm/tlb.h: struct vm_area_struct vma = { .vm_mm = > tlb->mm, }; > arch/arm64/mm/hugetlbpage.c:struct vm_area_struct vma = { .vm_mm = mm }; > arch/arm64/mm/hugetlbpage.c:struct vm_are

Re: [PATCHv3 1/3] mm: Introduce vma_init()

2018-07-25 Thread Kirill A. Shutemov
On Tue, Jul 24, 2018 at 01:41:58PM -0700, Andrew Morton wrote: > On Tue, 24 Jul 2018 13:16:33 -0700 Linus Torvalds > wrote: > > > On Tue, Jul 24, 2018 at 1:03 PM Andrew Morton > > wrote: > > > > > > > > > I'd sleep better if this became a kmem_cache_alloc() and the memset > > > was moved into

Re: [PATCHv3 1/3] mm: Introduce vma_init()

2018-07-24 Thread Andrew Morton
On Tue, 24 Jul 2018 13:16:33 -0700 Linus Torvalds wrote: > On Tue, Jul 24, 2018 at 1:03 PM Andrew Morton > wrote: > > > > > > I'd sleep better if this became a kmem_cache_alloc() and the memset > > was moved into vma_init(). > > Yeah, with the vma_init(), I guess the advantage of using > kmem

Re: [PATCHv3 1/3] mm: Introduce vma_init()

2018-07-24 Thread Linus Torvalds
On Tue, Jul 24, 2018 at 1:03 PM Andrew Morton wrote: > > > I'd sleep better if this became a kmem_cache_alloc() and the memset > was moved into vma_init(). Yeah, with the vma_init(), I guess the advantage of using kmem_cache_zalloc() is pretty dubious. Make it so. Linus

Re: [PATCHv3 1/3] mm: Introduce vma_init()

2018-07-24 Thread Andrew Morton
On Tue, 24 Jul 2018 15:11:37 +0300 "Kirill A. Shutemov" wrote: > Not all VMAs allocated with vm_area_alloc(). Some of them allocated on > stack or in data segment. > > The new helper can be use to initialize VMA properly regardless where > it was allocated. > > ... > > --- a/include/linux/mm.h

[PATCHv3 1/3] mm: Introduce vma_init()

2018-07-24 Thread Kirill A. Shutemov
Not all VMAs allocated with vm_area_alloc(). Some of them allocated on stack or in data segment. The new helper can be use to initialize VMA properly regardless where it was allocated. Signed-off-by: Kirill A. Shutemov --- include/linux/mm.h | 6 ++ kernel/fork.c | 6 ++ 2 files ch