]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: hugetlb_vmemmap: simplify reset_struct_pages()
authorMuchun Song <songmuchun@bytedance.com>
Fri, 19 Aug 2022 03:55:32 +0000 (11:55 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Aug 2022 05:03:07 +0000 (22:03 -0700)
commitce9d4561338ed26d73afabe0cbba29d9c2aecccf
tree07747e9222d1e1be28456fb359dc5fce0b706ca8
parent7d043ae282e46688117f0625082f3e2f27dd44dd
mm: hugetlb_vmemmap: simplify reset_struct_pages()

We can choose to copy three contiguous tail pages' content to the first
three pages instead of copying one by one to simplify the code and reduce
code size from 229 bytes to 63 bytes.  The BUILD_BUG_ON() aims to avoid
out-of-bounds accesses.

Link: https://lkml.kernel.org/r/20220819035532.6189-1-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb_vmemmap.c