*参照元 [#p2b56f01] #backlinks *説明 [#g0c9d29d] -パス: [[linux-4.4.1/mm/huge_memory.c]] -パス: 複数あり --CONFIG_TRANSPARENT_HUGEPAGE 有効: [[linux-4.4.1/mm/huge_memory.c]] --CONFIG_TRANSPARENT_HUGEPAGE 無効: [[linux-4.4.1/include/linux/huge_mm.h]] --[[linux-4.4.1/CONFIG_TRANSPARENT_HUGEPAGE]] -FIXME: これは何? --説明 **引数 [#q6cd0621] -struct page *page -- --[[linux-4.4.1/page]] -struct list_head *list -- --[[linux-4.4.1/list_head]] **返り値 [#y24da8e9] -int -- **参考 [#sda70e93] *実装 [#u52d8d47] **CONFIG_TRANSPARENT_HUGEPAGE 有効: linux-4.4.1/mm/huge_memory.c [#i754a956] /* * Split a hugepage into normal pages. This doesn't change the position of head * page. If @list is null, tail pages will be added to LRU list, otherwise, to * @list. Both head page and tail pages will inherit mapping, flags, and so on * from the hugepage. * Return 0 if the hugepage is split successfully otherwise return 1. */ int split_huge_page_to_list(struct page *page, struct list_head *list) { struct anon_vma *anon_vma; int ret = 1; - --[[linux-4.4.1/anon_vma]] BUG_ON(is_huge_zero_page(page)); BUG_ON(!PageAnon(page)); - --[[linux-4.4.1/BUG_ON()]] --[[linux-4.4.1/is_huge_zero_page()]] --[[linux-4.4.1/PageAnon()]] /* * The caller does not necessarily hold an mmap_sem that would prevent * the anon_vma disappearing so we first we take a reference to it * and then lock the anon_vma for write. This is similar to * page_lock_anon_vma_read except the write lock is taken to serialise * against parallel split or collapse operations. */ anon_vma = page_get_anon_vma(page); if (!anon_vma) goto out; anon_vma_lock_write(anon_vma); - --[[linux-4.4.1/page_get_anon_vma()]] --[[linux-4.4.1/anon_vma_lock_write()]] ret = 0; if (!PageCompound(page)) goto out_unlock; - --[[linux-4.4.1/PageCompound()]] BUG_ON(!PageSwapBacked(page)); __split_huge_page(page, anon_vma, list); count_vm_event(THP_SPLIT); - --[[linux-4.4.1/BUG_ON()]] --[[linux-4.4.1/PageSwapBacked()]] --[[linux-4.4.1/__split_huge_page()]] --[[linux-4.4.1/count_vm_event()]] BUG_ON(PageCompound(page)); - --[[linux-4.4.1/PageCompound()]] out_unlock: anon_vma_unlock_write(anon_vma); put_anon_vma(anon_vma); - --[[linux-4.4.1/anon_vma_unlock_write()]] --[[linux-4.4.1/put_anon_vma()]] out: return ret; } **CONFIG_TRANSPARENT_HUGEPAGE 無効: linux-4.4.1/include/linux/huge_mm.h [#e6ea3553] static inline int split_huge_page_to_list(struct page *page, struct list_head *list) { return 0; } *コメント [#n5bf9d26]