Function report |
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 activity | Download SCCT | Chinese |
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:
| Type | Parameter | Name |
|---|---|---|
| unsigned long | nr_to_scan | |
| struct lruvec * | lruvec | |
| struct list_head * | dst | |
| unsigned long * | nr_scanned | |
| struct scan_control * | sc | |
| enum lru_list | 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) |
| 1673 | total_scan += nr_pages |
| 1675 | If page_zonenum(page) > The highest zone to isolate pages for reclaim from Then |
| 1677 | nr_skipped[page_zonenum(page)] += nr_pages |
| 1678 | Continue |
| 1695 | nr_zone_taken[page_zonenum(page)] += 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 |
| 1720 | When zid < MAX_NR_ZONES cycle |
| 1721 | If Not nr_skipped[zid] Then Continue |
| 1724 | __count_zid_vm_events(PGSCAN_SKIP, zid, nr_skipped[zid]) |
| 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) |
| 1732 | Return nr_taken |
| Name | Describe |
|---|---|
| shrink_inactive_list | shrink_inactive_list() is a helper for shrink_node(). It returns the number* of reclaimed pages |
| shrink_active_list |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |