]> 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>
Mon, 22 Aug 2022 22:58:16 +0000 (15:58 -0700)
commit2b84bd987a6d117785020e1b2aae17d73a2c832f
tree440f621d913cd1e283c3a355d7f3aebe5e651dfe
parentce7a6349dd077fc55f601ce94546608c0338af74
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