函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap.c Create Date:2022-07-27 15:37:04
Last Modify:2022-05-23 13:40:24 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:lru_cache_add_active_or_unevictable*@page: the page to be added to LRU*@vma: vma in which page is mapped for determining reclaimability* Place @page on the active or unevictable LRU list, depending on its* evictability

函数原型:void lru_cache_add_active_or_unevictable(struct page *page, struct vm_area_struct *vma)

返回类型:void

参数:

类型参数名称
struct page *page
struct vm_area_struct *vma
463  VM_BUG_ON_PAGE(PageLRU(page), page)
465  如果此条件成立可能性大(为编译器优化)((Flags, see mm.h. & (VM_LOCKED | Special vmas that are non-mergable, non-mlock()able.* Note: mm/huge_memory.c VM_NO_THP depends on this definition.)) != VM_LOCKED)则SetPageActive(page)
467  否则如果非TestSetPageMlocked(page)则
473  We do not maintain differentials in a single processor configuration.* The functions directly modify the zone and global counters.
475  Disable counters
477  lru_cache_add - add a page to a page list*@page: the page to be added to the LRU.* Queue the page for addition to the LRU via pagevec. The decision on whether* to add the page to the [in]active [file|anon] list is deferred until the* pagevec is drained
调用者
名称描述
wp_page_copyHandle the case of a page which we actually need to copy to a new page.* Called with mmap_sem locked and the old page referenced, but* without the ptl held.* High level logic flow:* - Allocate a page, copy the content of the old page to the new one.
do_swap_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases
do_anonymous_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with mmap_sem still held, but pte unmapped and unlocked.
alloc_set_ptealloc_set_pte - setup new PTE entry for given page and add reverse page* mapping
unuse_pteNo need to decide whether this PTE shares the swap entry with others,* just let do_wp_page work it out if a write is requested later - to* force COW, vm_page_prot omits write permission from any private vma.
__do_huge_pmd_anonymous_page
do_huge_pmd_wp_page_fallback
do_huge_pmd_wp_page
collapse_huge_page
mcopy_atomic_pte
__replace_page__replace_page - replace page in vma by new page