]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit69ec1941c7e9bc7f5d58a1f9ea33f0b8db0b4400
tree52a10515ade5a20f50b347bd26ea2d842d472147
parentee759a2dba74e8ded2d13b682038e38a8c58f834
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