Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmscan.c Create Date:2022-07-28 14:17:37
Last Modify:2022-05-23 13:41:30 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Same as remove_mapping, but if the page is removed from the mapping, it* gets returned with a refcount of 0.

Proto:static int __remove_mapping(struct address_space *mapping, struct page *page, bool reclaimed, struct mem_cgroup *target_memcg)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
struct page *page
boolreclaimed
struct mem_cgroup *target_memcg
871  BUG_ON(!PageLocked(page))
872  BUG_ON(mapping != page_mapping(page))
874  xa_lock_irqsave( & i_pages, flags)
900  refcount = 1 + Returns the number of pages in this potentially compound page.
901  If Not page_ref_freeze(page, refcount) Then Go to cannot_free
904  If Value for the false possibility is greater at compile time(PageDirty(page)) Then
905  page_ref_unfreeze(page, refcount)
906  Go to cannot_free
909  If PageSwapCache(page) Then
910  swp_entry_t swap = {val = page_private(page)}
911  mem_cgroup_swapout(page, swap)
912  __delete_from_swap_cache(page, swap)
913  xa_unlock_irqrestore( & i_pages, flags)
914  put_swap_page(page, swap)
915  Else
917  void * shadow = NULL
919  freepage = freepage
936  If reclaimed && page_is_file_cache - should the page be on a file LRU or anon LRU?*@page: the page to test* Returns 1 if @page is page cache page backed by a regular filesystem,* or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed && Not mapping_exiting(mapping) && Not dax_mapping(mapping) Then shadow = linux/mm/workingset.c
939  Delete a page from the page cache and free it. Caller has to make* sure the page is locked and that nobody else uses it - or that usage* is safe. The caller must hold the i_pages lock.
940  xa_unlock_irqrestore( & i_pages, flags)
942  If (freepage != NULL) Then freepage(page)
946  Return 1
948  cannot_free :
949  xa_unlock_irqrestore( & i_pages, flags)
950  Return 0
Caller
NameDescribe
remove_mappingAttempt to detach a locked page from its ->mapping. If it is dirty or if* someone else has a ref on the page, abort and return 0. If it was* successfully detached, return 1. Assumes the caller has a single ref on* this page.
shrink_page_listshrink_page_list() returns the number of reclaimed pages