Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\rmap.c Create Date:2022-07-28 14:56:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:void page_add_file_rmap(struct page *page, bool compound)

Type:void

Parameter:

TypeParameterName
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  If 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 Then
1206  When i < HPAGE_PMD_NR cycle
1210  If Not atomic_inc_and_test(compound_mapcount_ptr(page)) Then Go to out
1212  If PageSwapBacked(page) Then __inc_node_page_state(page, NR_SHMEM_PMDMAPPED)
1214  Else __inc_node_page_state(page, NR_FILE_PMDMAPPED)
1216  Else
1224  If Not 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.) Then Go to 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)
Caller
NameDescribe
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.