linux-4.4.1/__pte_alloc()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#w8d569df]
#backlinks
*説明 [#t96f1f13]
-パス: [[linux-4.4.1/mm/memory.c]]
-FIXME: これは何?
--説明
**引数 [#k90c29a7]
-struct mm_struct *mm
--
--[[linux-4.4.1/mm_struct]]
-struct vm_area_struct *vma
--
--[[linux-4.4.1/vm_area_struct]]
-pmd_t *pmd
--
--[[linux-4.4.1/pmd_t]]
-unsigned long address
--
**返り値 [#u2274928]
-int
--
**参考 [#cbd8e90f]
*実装 [#gfec7a44]
int __pte_alloc(struct mm_struct *mm, struct vm_area_str...
pmd_t *pmd, unsigned long address)
{
spinlock_t *ptl;
pgtable_t new = pte_alloc_one(mm, address);
int wait_split_huge_page;
if (!new)
return -ENOMEM;
-
--[[linux-4.4.1/spinlock_t]]
--[[linux-4.4.1/pgtable_t]]
--[[linux-4.4.1/pte_alloc_one()]]
/*
* Ensure all pte setup (eg. pte page lock and p...
* visible before the pte is made visible to oth...
* put into page tables.
*
* The other side of the story is the pointer ch...
* table walking code (when walking the page tab...
* ie. most of the time). Fortunately, these dat...
* of a chain of data-dependent loads, meaning m...
* being the notable exception) will already gua...
* seen in-order. See the alpha page table acces...
* smp_read_barrier_depends() barriers in page t...
*/
smp_wmb(); /* Could be smp_wmb__xxx(before|after...
-
--[[linux-4.4.1/smp_wmb()]]
ptl = pmd_lock(mm, pmd);
wait_split_huge_page = 0;
-
--[[linux-4.4.1/pmd_lock()]]
if (likely(pmd_none(*pmd))) { /* Has another p...
atomic_long_inc(&mm->nr_ptes);
pmd_populate(mm, pmd, new);
new = NULL;
-
--[[linux-4.4.1/likely()]]
--[[linux-4.4.1/pmd_none()]]
--[[linux-4.4.1/atomic_long_inc()]]
--[[linux-4.4.1/pmd_populate()]]
} else if (unlikely(pmd_trans_splitting(*pmd)))
wait_split_huge_page = 1;
-
--[[linux-4.4.1/unlikely()]]
--[[linux-4.4.1/pmd_trans_splitting()]]
spin_unlock(ptl);
-
--[[linux-4.4.1/spin_unlock()]]
if (new)
pte_free(mm, new);
-
--[[linux-4.4.1/pte_free()]]
if (wait_split_huge_page)
wait_split_huge_page(vma->anon_vma, pmd);
-
--[[linux-4.4.1/wait_split_huge_page()]]
return 0;
}
*コメント [#qc949721]
終了行:
*参照元 [#w8d569df]
#backlinks
*説明 [#t96f1f13]
-パス: [[linux-4.4.1/mm/memory.c]]
-FIXME: これは何?
--説明
**引数 [#k90c29a7]
-struct mm_struct *mm
--
--[[linux-4.4.1/mm_struct]]
-struct vm_area_struct *vma
--
--[[linux-4.4.1/vm_area_struct]]
-pmd_t *pmd
--
--[[linux-4.4.1/pmd_t]]
-unsigned long address
--
**返り値 [#u2274928]
-int
--
**参考 [#cbd8e90f]
*実装 [#gfec7a44]
int __pte_alloc(struct mm_struct *mm, struct vm_area_str...
pmd_t *pmd, unsigned long address)
{
spinlock_t *ptl;
pgtable_t new = pte_alloc_one(mm, address);
int wait_split_huge_page;
if (!new)
return -ENOMEM;
-
--[[linux-4.4.1/spinlock_t]]
--[[linux-4.4.1/pgtable_t]]
--[[linux-4.4.1/pte_alloc_one()]]
/*
* Ensure all pte setup (eg. pte page lock and p...
* visible before the pte is made visible to oth...
* put into page tables.
*
* The other side of the story is the pointer ch...
* table walking code (when walking the page tab...
* ie. most of the time). Fortunately, these dat...
* of a chain of data-dependent loads, meaning m...
* being the notable exception) will already gua...
* seen in-order. See the alpha page table acces...
* smp_read_barrier_depends() barriers in page t...
*/
smp_wmb(); /* Could be smp_wmb__xxx(before|after...
-
--[[linux-4.4.1/smp_wmb()]]
ptl = pmd_lock(mm, pmd);
wait_split_huge_page = 0;
-
--[[linux-4.4.1/pmd_lock()]]
if (likely(pmd_none(*pmd))) { /* Has another p...
atomic_long_inc(&mm->nr_ptes);
pmd_populate(mm, pmd, new);
new = NULL;
-
--[[linux-4.4.1/likely()]]
--[[linux-4.4.1/pmd_none()]]
--[[linux-4.4.1/atomic_long_inc()]]
--[[linux-4.4.1/pmd_populate()]]
} else if (unlikely(pmd_trans_splitting(*pmd)))
wait_split_huge_page = 1;
-
--[[linux-4.4.1/unlikely()]]
--[[linux-4.4.1/pmd_trans_splitting()]]
spin_unlock(ptl);
-
--[[linux-4.4.1/spin_unlock()]]
if (new)
pte_free(mm, new);
-
--[[linux-4.4.1/pte_free()]]
if (wait_split_huge_page)
wait_split_huge_page(vma->anon_vma, pmd);
-
--[[linux-4.4.1/wait_split_huge_page()]]
return 0;
}
*コメント [#qc949721]
ページ名: