Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int page_referenced(struct page *page, int is_locked, struct mem_cgroup *memcg, unsigned long *vm_flags)

Type:int

Parameter:

TypeParameterName
struct page *page
intis_locked
struct mem_cgroup *memcg
unsigned long *vm_flags
862  we_locked = 0
863  struct page_referenced_arg pra = {mapcount = total_mapcount(page), memcg = memcg, }
867  struct rmap_walk_control rwc = { executed on each vma where page is mapped = page_referenced_one, passed to rmap_one() and invalid_vma() = (void * ) & pra, for getting anon_lock by optimized way rather than default = Similar to page_get_anon_vma() except it locks the anon_vma.* Its a little more complex as it tries to keep the fast path to a single* atomic op -- the trylock. If we fail the trylock, we fall back to getting a, }
873  vm_flags = 0
874  If Not mapcount Then Return 0
877  If Not Neutral page->mapping pointer to address_space or anon_vma or other Then Return 0
880  If Not is_locked && ( Not PageAnon(page) || A KSM page is one of those write-protected "shared pages" or "merged pages"* which KSM maps into multiple mms, wherever identical anonymous page content* is found in VM_MERGEABLE vmas. It's a PageAnon page, pointing not to any) Then
881  we_locked = Return true if the page was successfully locked
882  If Not we_locked Then Return 1
891  If memcg Then
892  for skipping uninterested vma = invalid_page_referenced_vma
895  rmap_walk(page, & rwc)
896  vm_flags = vm_flags
898  If we_locked Then 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.
901  Return referenced
Caller
NameDescribe
shrink_active_list
page_check_references