函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:total_mapcount

函数原型:int total_mapcount(struct page *page)

返回类型:int

参数:

类型参数名称
struct page *page
2584  VM_BUG_ON_PAGE(PageTail(page), page)
2586  如果此条件成立可能性大(为编译器优化)(!PageCompound(page))则返回:atomic_read( & * If the page can be mapped to userspace, encodes the number * of times this page is referenced by a page table.)加1
2589  compound等于compound_mapcount(page)
2590  如果PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details.则返回:compound
2592  ret等于compound
2593 i小于HPAGE_PMD_NR循环ret加等于atomic_read( & * If the page can be mapped to userspace, encodes the number * of times this page is referenced by a page table.)加1
2596  如果非PageAnon(page)则返回:retcompoundHPAGE_PMD_NR
2598  如果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)ret减等于HPAGE_PMD_NR
2600  返回:ret
调用者
名称描述
page_mapcount_is_zero
can_split_huge_pageRacy check whether the huge page can be split
split_huge_page_to_listThis function splits huge page into normal pages. @page can point to any* subpage of huge page to split. Split doesn't change the position of @page.* Only caller must hold pin on the @page, otherwise split fails with -EBUSY.* The huge page must be locked.
page_referencedpage_referenced - test if the page was referenced*@page: the page to test*@is_locked: caller holds lock on the page*@memcg: target memory cgroup*@vm_flags: collect encountered vma->vm_flags who actually referenced the page* Quick test_and_clear_referenced