Re: [PATCH] mm/hugetlb: use some helper functions to cleanup code

2021-03-02 Thread Mike Kravetz
On 2/9/21 10:53 PM, Miaohe Lin wrote: > We could use pages_per_huge_page to get the number of pages per hugepage, > use get_hstate_idx to calculate hstate index, and use hstate_is_gigantic > to check if a hstate is gigantic to make code more succinct. > > Signed-off-by: Miaohe Lin These are all

Re: [PATCH] mm/hugetlb: use some helper functions to cleanup code

2021-03-02 Thread Miaohe Lin
On 2021/2/10 14:53, Miaohe Lin wrote: > We could use pages_per_huge_page to get the number of pages per hugepage, > use get_hstate_idx to calculate hstate index, and use hstate_is_gigantic > to check if a hstate is gigantic to make code more succinct. > > Signed-off-by: Miaohe Lin friendly ping

Re: [PATCH] mm/hugetlb: use some helper functions to cleanup code

2021-02-10 Thread Miaohe Lin
On 2021/2/10 16:35, David Hildenbrand wrote: > On 10.02.21 07:53, Miaohe Lin wrote: >> We could use pages_per_huge_page to get the number of pages per hugepage, >> use get_hstate_idx to calculate hstate index, and use hstate_is_gigantic >> to check if a hstate is gigantic to make code more

Re: [PATCH] mm/hugetlb: use some helper functions to cleanup code

2021-02-10 Thread David Hildenbrand
On 10.02.21 07:53, Miaohe Lin wrote: We could use pages_per_huge_page to get the number of pages per hugepage, use get_hstate_idx to calculate hstate index, and use hstate_is_gigantic to check if a hstate is gigantic to make code more succinct. Another suggestion, please collect and group

[PATCH] mm/hugetlb: use some helper functions to cleanup code

2021-02-09 Thread Miaohe Lin
We could use pages_per_huge_page to get the number of pages per hugepage, use get_hstate_idx to calculate hstate index, and use hstate_is_gigantic to check if a hstate is gigantic to make code more succinct. Signed-off-by: Miaohe Lin --- fs/hugetlbfs/inode.c | 2 +- mm/hugetlb.c | 6