linux-4.4.1/split_huge_page_to_list()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#p2b56f01]
#backlinks
*説明 [#g0c9d29d]
-パス: 複数あり
--CONFIG_TRANSPARENT_HUGEPAGE 有効: [[linux-4.4.1/mm/huge...
--CONFIG_TRANSPARENT_HUGEPAGE 無効: [[linux-4.4.1/include...
--[[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_m...
/*
* Split a hugepage into normal pages. This doesn't chan...
* page. If @list is null, tail pages will be added to L...
* @list. Both head page and tail pages will inherit map...
* from the hugepage.
* Return 0 if the hugepage is split successfully otherw...
*/
int split_huge_page_to_list(struct page *page, struct li...
{
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 tha...
* the anon_vma disappearing so we first we take a refe...
* and then lock the anon_vma for write. This is simila...
* page_lock_anon_vma_read except the write lock is tak...
* 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/l...
static inline int
split_huge_page_to_list(struct page *page, struct list_h...
{
return 0;
}
*コメント [#n5bf9d26]
終了行:
*参照元 [#p2b56f01]
#backlinks
*説明 [#g0c9d29d]
-パス: 複数あり
--CONFIG_TRANSPARENT_HUGEPAGE 有効: [[linux-4.4.1/mm/huge...
--CONFIG_TRANSPARENT_HUGEPAGE 無効: [[linux-4.4.1/include...
--[[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_m...
/*
* Split a hugepage into normal pages. This doesn't chan...
* page. If @list is null, tail pages will be added to L...
* @list. Both head page and tail pages will inherit map...
* from the hugepage.
* Return 0 if the hugepage is split successfully otherw...
*/
int split_huge_page_to_list(struct page *page, struct li...
{
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 tha...
* the anon_vma disappearing so we first we take a refe...
* and then lock the anon_vma for write. This is simila...
* page_lock_anon_vma_read except the write lock is tak...
* 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/l...
static inline int
split_huge_page_to_list(struct page *page, struct list_h...
{
return 0;
}
*コメント [#n5bf9d26]
ページ名: