Re: [PATCH v2 1/6] mm/huge_memory.c: rework the function vma_adjust_trans_huge()

2021-03-17 Thread Peter Xu
On Wed, Mar 17, 2021 at 10:18:40AM +0800, Miaohe Lin wrote: > Hi: > On 2021/3/17 4:40, Peter Xu wrote: > > On Tue, Mar 16, 2021 at 08:40:02AM -0400, Miaohe Lin wrote: > >> +static inline void split_huge_pmd_if_needed(struct vm_area_struct *vma, > >> unsigned long address) > >> +{ > >> + /* > >>

Re: [PATCH v2 1/6] mm/huge_memory.c: rework the function vma_adjust_trans_huge()

2021-03-16 Thread Miaohe Lin
Hi: On 2021/3/17 4:40, Peter Xu wrote: > On Tue, Mar 16, 2021 at 08:40:02AM -0400, Miaohe Lin wrote: >> +static inline void split_huge_pmd_if_needed(struct vm_area_struct *vma, >> unsigned long address) >> +{ >> +/* >> + * If the new address isn't hpage aligned and it could previously >>

Re: [PATCH v2 1/6] mm/huge_memory.c: rework the function vma_adjust_trans_huge()

2021-03-16 Thread Peter Xu
On Tue, Mar 16, 2021 at 08:40:02AM -0400, Miaohe Lin wrote: > +static inline void split_huge_pmd_if_needed(struct vm_area_struct *vma, > unsigned long address) > +{ > + /* > + * If the new address isn't hpage aligned and it could previously > + * contain an hugepage: check if we

[PATCH v2 1/6] mm/huge_memory.c: rework the function vma_adjust_trans_huge()

2021-03-16 Thread Miaohe Lin
The current implementation of vma_adjust_trans_huge() contains some duplicated codes. Add helper function to get rid of these codes to make it more succinct. Signed-off-by: Miaohe Lin --- mm/huge_memory.c | 44 +++- 1 file changed, 19 insertions(+), 25