]> git.ipfire.org Git - people/ms/linux.git/commit - mm/huge_memory.c
mm/huge_memory: comment the subtly logic in __split_huge_pmd
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 4 Jul 2022 13:22:00 +0000 (21:22 +0800)
committerakpm <akpm@linux-foundation.org>
Mon, 18 Jul 2022 00:14:46 +0000 (17:14 -0700)
commitcea3332808f92c0120fb0b157c56d48639e0c713
tree52a10515ade5a20f50b347bd26ea2d842d472147
parentd764afedfb04e4eaf04b175c5ac54ffa4a423070
mm/huge_memory: comment the subtly logic in __split_huge_pmd

It's dangerous and wrong to call page_folio(pmd_page(*pmd)) when pmd isn't
present. But the caller guarantees pmd is present when folio is set. So we
should be safe here. Add comment to make it clear.

Link: https://lkml.kernel.org/r/20220704132201.14611-16-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c