Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static unsigned long isolate_lru_pages(unsigned long nr_to_scan, struct lruvec *lruvec, struct list_head *dst, unsigned long *nr_scanned, struct scan_control *sc, enum lru_list lru)

Type:unsigned long

Parameter:

TypeParameterName
unsigned longnr_to_scan
struct lruvec *lruvec
struct list_head *dst
unsigned long *nr_scanned
struct scan_control *sc
enum lru_listlru
1653  src = lists[lru]
1654  nr_taken = 0
1655  unsigned long nr_zone_taken[MAX_NR_ZONES] = {0}
1656  unsigned long nr_skipped[MAX_NR_ZONES] = {0, }
1657  skipped = 0
1659  LIST_HEAD(pages_skipped)
1660  mode = If Can mapped pages be reclaimed? Then 0 Else Isolate unmapped pages
1662  total_scan = 0
1663  scan = 0
1664  When scan < nr_to_scan && Not list_empty - tests whether a list is empty*@head: the list to test. cycle
1667  page = lru_to_page(src)
1668  prefetchw_prev_lru_page(page, src, flags)
1670  VM_BUG_ON_PAGE(!PageLRU(page), page)
1672  nr_pages = Returns the number of pages in this potentially compound page.
1673  total_scan += nr_pages
1678  Continue
1691  scan += nr_pages
1694  nr_taken += nr_pages
1697  Break
1702  Continue
1704  Default
1705  BUG()
1716  If Not list_empty - tests whether a list is empty*@head: the list to test. Then
1719  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.
1720  When zid < MAX_NR_ZONES cycle
1721  If Not nr_skipped[zid] Then Continue
1725  skipped += nr_skipped[zid]
1728  nr_scanned = total_scan
1729  trace_mm_vmscan_lru_isolate( The highest zone to isolate pages for reclaim from , Allocation order , nr_to_scan, total_scan, skipped, nr_taken, mode, lru)
1731  Update LRU sizes after isolating pages. The LRU size updates must* be complete before mem_cgroup_update_lru_size due to a santity check.
1732  Return nr_taken
Caller
NameDescribe
shrink_inactive_listshrink_inactive_list() is a helper for shrink_node(). It returns the number* of reclaimed pages
shrink_active_list