函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmscan.c Create Date:2022-07-27 15:42:30
Last Modify:2022-05-23 13:41:30 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:shrink_active_list

函数原型:static void shrink_active_list(unsigned long nr_to_scan, struct lruvec *lruvec, struct scan_control *sc, enum lru_list lru)

返回类型:void

参数:

类型参数名称
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  当非链表为空循环
2042  cond_resched()
2043  page等于lru_to_page( & l_hold)
2044  删除链表项
2048  继续下一循环
2061  nr_rotated加等于hpage_nr_pages(page)
2073  继续下一循环
2077  ClearPageActive(page)
2078  SetPageWorkingset(page)
2079  添加链表项
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  为栈加入第二个链表项
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(全局结点ID, nr_taken, nr_activate, nr_deactivate, nr_rotated, Scan (total_size >> priority) pages at once , file)
调用者
名称描述
shrink_list
shrink_lruvec
age_active_anon