函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup.c Create Date:2022-07-27 15:59:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:follow_page_pte

函数原型:static struct page *follow_page_pte(struct vm_area_struct *vma, unsigned long address, pmd_t *pmd, unsigned int flags, struct dev_pagemap **pgmap)

返回类型:struct page

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddress
pmd_t *pmd
unsigned intflags
struct dev_pagemap **pgmap
177  mm等于The address space we belong to.
182  retry :
183  如果此条件成立可能性小(为编译器优化)(pmd_bad( * pmd))则返回:no_page_table(vma, flags)
186  ptep等于pte_offset_map_lock(mm, pmd, address, & ptl)
187  pte等于ptep
188  如果非pte_present(pte)则
195  如果此条件成立可能性大(为编译器优化)(!(flags & wait for page to replace migration entry ))则转到:no_page
197  如果pte_none(pte)则转到:no_page
199  entry等于Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t.
200  如果非is_migration_entry(entry)则转到:no_page
202  pte_unmap_unlock(ptep, ptl)
203  migration_entry_wait(mm, pmd, address)
204  转到:retry
206  如果flags按位与rce NUMA hinting page fault Technically a PTE can be PROTNONE even when not doing NUMA balancing but* the only case the kernel cares is for NUMA balancing and is only ever set* when the VMA is accessible. For PROT_NONE VMAs, the PTEs are not marked则转到:no_page
208  如果flags按位与check pte is writable 且非FOLL_FORCE can write to even unwritable pte's, but only* after we've gone through a COW cycle and they are dirty.
209  pte_unmap_unlock(ptep, ptl)
210  返回:NULL
213  page等于vm_normal_page(vma, address, pte)
214  如果非pagepte_devmap(pte)且flags按位与do get_page on page
219  pgmap等于get_dev_pagemap(pte_pfn(pte), * pgmap)
220  如果pgmappage等于pte_page(pte)
222  否则转到:no_page
224  否则如果此条件成立可能性小(为编译器优化)(!page)则
227  page等于错误号
228  转到:out
231  如果is_zero_pfn(pte_pfn(pte))则
232  page等于pte_page(pte)
233  否则
237  page等于错误号
238  转到:out
242  如果flags按位与don't return transhuge pages, split them PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.
244  get_page(page)
245  pte_unmap_unlock(ptep, ptl)
246  lock_page may only be called if we have the page's inode pinned.
247  ret等于split_huge_page(page)
248  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
249  put_page(page)
250  如果ret则返回:错误号
252  转到:retry
255  如果flags按位与do get_page on page
257  page等于错误号
258  转到:out
261  如果flags按位与mark page accessed
262  如果flags按位与check pte is writable 且非The following only work if pte_present() is true.* Undefined behaviour if not..且非PageDirty(page)则Dirty a page
270  Mark a page as having seen activity.* inactive,unreferenced -> inactive,referenced* inactive,referenced -> active,unreferenced* active,unreferenced -> active,referenced* When a newly allocated page is not yet visible, so safe for non-atomic ops,
272  如果flags按位与lock present pages Flags, see mm.h. 按位与VM_LOCKED
274  如果PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.则转到:out
287  lru_add_drain()
298  out :
299  pte_unmap_unlock(ptep, ptl)
300  返回:page
301  no_page :
302  pte_unmap_unlock(ptep, ptl)
303  如果非pte_none(pte)则返回:NULL
305  返回:no_page_table(vma, flags)
调用者
名称描述
follow_pmd_mask