Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\compaction.c Create Date:2022-07-28 14:30:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:solate_migratepages_block() - isolate all migrate-able pages within* a single pageblock*@cc: Compaction control structure.*@low_pfn: The first PFN to isolate*@end_pfn: The one-past-the-last PFN to isolate, within same pageblock

Proto:static unsigned long isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, unsigned long end_pfn, isolate_mode_t isolate_mode)

Type:unsigned long

Parameter:

TypeParameterName
struct compact_control *cc
unsigned longlow_pfn
unsigned longend_pfn
isolate_mode_tisolate_mode
785  pgdat = zone_pgdat
786  nr_scanned = 0 , nr_isolated = 0
788  flags = 0
789  bool locked = false
790  struct page * page = NULL, * valid_page = NULL
791  start_pfn = low_pfn
792  bool skip_on_failure = false
793  next_skip_pfn = 0
794  bool skip_updated = false
801  When Value for the false possibility is greater at compile time(Similar to reclaim, but different enough that they don't share logic ) cycle
803  If Async or sync migration mode == MIGRATE_ASYNC Then Return 0
806  gestion_wait - wait for a backing_dev to become uncongested*@sync: SYNC or ASYNC IO*@timeout: timeout in jiffies* Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit* write congestion
808  If fatal_signal_pending(current process) Then Return 0
812  cond_resched()
814  If False from kcompactd or /proc/... && Async or sync migration mode == MIGRATE_ASYNC Then
815  skip_on_failure = true
816  next_skip_pfn = block_end_pfn(low_pfn, rder a direct compactor needs )
820  When low_pfn < end_pfn cycle
822  If skip_on_failure && low_pfn >= next_skip_pfn Then
829  If nr_isolated Then Break
852  low_pfn = 0
853  Go to fatal_pending
856  If Not pfn_valid_within(low_pfn) Then Go to isolate_fail
858  nr_scanned++
860  page = pfn_to_page(low_pfn)
870  low_pfn = end_pfn
871  Go to isolate_abort
873  valid_page = page
892  Continue
902  If PageCompound(page) Then
907  Go to isolate_fail
915  If Not PageLRU(page) Then
932  Go to isolate_fail
940  If Not page_mapping(page) && page_count(page) > page_mapcount(page) Then Go to isolate_fail
948  If Not (gfp mask of a direct compactor & __GFP_FS) && page_mapping(page) Then Go to isolate_fail
952  If Not locked Then
957  If Not skip_updated Then
958  skip_updated = true
959  If test_and_set_skip(cc, page, low_pfn) Then Go to isolate_abort
964  If Not PageLRU(page) Then Go to isolate_fail
978  lruvec = mem_cgroup_page_lruvec(page, pgdat)
981  If Attempt to remove the specified page from its LRU. Only take this page* if it is of the appropriate PageActive status. Pages which are being* freed elsewhere are also ignored.* returns 0 on success, -ve errno on failure. != 0 Then Go to isolate_fail
984  VM_BUG_ON_PAGE(PageCompound(page), page)
987  del_page_from_lru_list(page, lruvec, page_lru - which LRU list should a page be on?*@page: the page to test* Returns the LRU list a page should be on, as an index* into the array of LRU lists.)
988  inc_node_page_state(page, Temporary isolated pages from anon lru + 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)
991  isolate_success :
992  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.
993  Number of pages to migrate ++
994  nr_isolated++
1004  ++low_pfn
1005  Break
1008  Continue
1009  isolate_fail :
1010  If Not skip_on_failure Then Continue
1018  If nr_isolated Then
1019  If locked Then
1025  nr_isolated = 0
1028  If low_pfn < next_skip_pfn Then
1029  low_pfn = next_skip_pfn - 1
1042  If Value for the false possibility is greater at compile time(low_pfn > end_pfn) Then low_pfn = end_pfn
1045  isolate_abort :
1046  If locked Then spin_unlock_irqrestore( & Write-intensive fields used by page reclaim , flags)
1057  If low_pfn == end_pfn && ( Not nr_isolated || Rescanning the same pageblock ) Then
1058  If valid_page && Not skip_updated Then set_pageblock_skip(valid_page)
1060  update_cached_migrate(cc, low_pfn)
1063  trace_mm_compaction_isolate_migratepages(start_pfn, low_pfn, nr_scanned, nr_isolated)
1066  fatal_pending :
1067  total_migrate_scanned += nr_scanned
1068  If nr_isolated Then count_compact_events(COMPACTISOLATED, nr_isolated)
1071  Return low_pfn
Caller
NameDescribe
isolate_migratepages_rangesolate_migratepages_range() - isolate migrate-able pages in a PFN range*@cc: Compaction control structure