Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:shrink_active_list

Proto:static void shrink_active_list(unsigned long nr_to_scan, struct lruvec *lruvec, struct scan_control *sc, enum lru_list lru)

Type:void

Parameter:

TypeParameterName
unsigned longnr_to_scan
struct lruvec *lruvec
struct scan_control *sc
enum lru_listlru
2016  LIST_HEAD(l_hold)
2017  LIST_HEAD(l_active)
2018  LIST_HEAD(l_inactive)
2020  reclaim_stat = reclaim_stat
2022  nr_rotated = 0
2023  file = is_file_lru(lru)
2024  pgdat = lruvec_pgdat(lruvec)
2026  lru_add_drain()
2028  spin_lock_irq( & Write-intensive fields used by page reclaim )
2030  nr_taken = pgdat->lru_lock is heavily contended. Some of the functions that* shrink the lists perform better by taking out a batch of pages* and working on them outside the LRU lock.* For pagecache intensive workloads, this function is the hottest
2033  __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken)
2034  recent_scanned[file] += nr_taken
2036  __count_vm_events(PGREFILL, nr_scanned)
2037  __count_memcg_events(lruvec_memcg(lruvec), PGREFILL, nr_scanned)
2039  spin_unlock_irq( & Write-intensive fields used by page reclaim )
2041  When Not list_empty - tests whether a list is empty*@head: the list to test. cycle
2042  cond_resched()
2043  page = lru_to_page( & l_hold)
2044  deletes entry from list
2048  Continue
2077  ClearPageActive(page)
2078  SetPageWorkingset(page)
2079  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
2085  spin_lock_irq( & Write-intensive fields used by page reclaim )
2092  * The pageout code in vmscan.c keeps track of how many of the * mem/swap backed and file backed pages are referenced. * The higher the rotated/scanned ratio, the more valuable * that cache is. * The anon LRU stats live in [0], file LRU stats in [1][file] += nr_rotated
2094  nr_activate = This moves pages from @list to corresponding LRU list.* We move them the other way if the page is referenced by one or more* processes, from rmap.* If the pages are mostly unmapped, the processing is fast and it is
2095  nr_deactivate = This moves pages from @list to corresponding LRU list.* We move them the other way if the page is referenced by one or more* processes, from rmap.* If the pages are mostly unmapped, the processing is fast and it is
2097  list_splice - join two lists, this is designed for stacks*@list: the new list to add.*@head: the place to add it in the first list.
2099  __count_vm_events(PGDEACTIVATE, nr_deactivate)
2100  __count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, nr_deactivate)
2102  __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, - nr_taken)
2103  spin_unlock_irq( & Write-intensive fields used by page reclaim )
2105  mem_cgroup_uncharge_list( & l_active)
2106  free_unref_page_list( & l_active)
2107  trace_mm_vmscan_lru_shrink_active(node_id, nr_taken, nr_activate, nr_deactivate, nr_rotated, Scan (total_size >> priority) pages at once , file)
Caller
NameDescribe
shrink_list
shrink_lruvec
age_active_anon