函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:follow_trans_huge_pmd

函数原型:struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd, unsigned int flags)

返回类型:struct page

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddr
pmd_t *pmd
unsigned intflags
1471  mm等于The address space we belong to.
1472  struct page * page = NULL
1474  assert_spin_locked(pmd_lockptr(mm, pmd))
1476  如果flags按位与check pte is writable 且非FOLL_FORCE can write to even unwritable pmd's, but only* after we've gone through a COW cycle and they are dirty.则转到:out
1480  如果flags按位与give error on hole if it would be zero is_huge_zero_pmd( * pmd)则返回:错误号
1484  如果flags按位与rce NUMA hinting page fault pmd_protnone( * pmd)则转到:out
1487  page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:( * pmd)
1488  VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page)
1489  如果flags按位与mark page accessed touch_pmd(vma, addr, pmd, flags)
1491  如果flags按位与lock present pages Flags, see mm.h. 按位与VM_LOCKED
1513  如果PageAnon(page)且compound_mapcount(page)不等于1则转到:skip_mlock
1515  如果PageDoubleMap indicates that the compound page is mapped with PTEs as well* as PMDs.* This is required for optimization of rmap operations for THP: we can postpone* per small page mapcount accounting (and its overhead from atomic operations)或非 See page-flags.h for PAGE_MAPPING_FLAGS 则转到:skip_mlock
1517  如果非Return true if the page was successfully locked则转到:skip_mlock
1519  lru_add_drain()
1520  如果 See page-flags.h for PAGE_MAPPING_FLAGS 且非PageDoubleMap indicates that the compound page is mapped with PTEs as well* as PMDs.* This is required for optimization of rmap operations for THP: we can postpone* per small page mapcount accounting (and its overhead from atomic operations)Mark page as mlocked if not already.* If page on LRU, isolate and putback to move to unevictable list.
1522  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.
1524  skip_mlock :
1525  page加等于addr按位与HPAGE_PMD_MASK的反的值右移PAGE_SHIFT determines the page size
1526  VM_BUG_ON_PAGE(!PageCompound(page) && !is_zone_device_page(page), page)
1527  如果flags按位与do get_page on page get_page(page)
1530  out :
1531  返回:page
调用者
名称描述
follow_pmd_mask