函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:page_add_file_rmap - add pte mapping to a file page*@page: the page to add the mapping to*@compound: charge the page as compound or small page* The caller needs to hold the pte lock.

函数原型:void page_add_file_rmap(struct page *page, bool compound)

返回类型:void

参数:

类型参数名称
struct page *page
boolcompound
1201  nr等于1
1203  VM_BUG_ON_PAGE(compound && !PageHuge() only returns true for hugetlbfs pages, but not for* normal or transparent huge pages.* PageTransHuge() returns true for both transparent huge and* hugetlbfs pages, but not normal pages. PageTransHuge() can only be, page)
1204  lock_page_memcg(page)
1205  如果compoundPageHuge() only returns true for hugetlbfs pages, but not for* normal or transparent huge pages.* PageTransHuge() returns true for both transparent huge and* hugetlbfs pages, but not normal pages. PageTransHuge() can only be
1206 i小于HPAGE_PMD_NR循环
1210  如果非atomic_inc_and_test(compound_mapcount_ptr(page))则转到:out
1212  如果PageSwapBacked(page)则__inc_node_page_state(page, NR_SHMEM_PMDMAPPED)
1214  否则__inc_node_page_state(page, NR_FILE_PMDMAPPED)
1216  否则
1224  如果非atomic_inc_and_test( & * If the page can be mapped to userspace, encodes the number * of times this page is referenced by a page table.)则转到:out
1227  __mod_lruvec_page_state(page, pagecache pages mapped into pagetables. only modified from process context , nr)
1228  out :
1229  unlock_page_memcg(page)
调用者
名称描述
alloc_set_ptealloc_set_pte - setup new PTE entry for given page and add reverse page* mapping
remove_migration_pteRestore a potential migration pte to a working pte entry
insert_pageThis is the old fallback for page remapping.* For historical reasons, it only allows reserved pages. Only* old drivers should use this, and they needed to mark their* pages reserved for the old functions anyway.