函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\compaction.c Create Date:2022-07-27 15:55:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:static unsigned long isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, unsigned long end_pfn, isolate_mode_t isolate_mode)

返回类型:unsigned long

参数:

类型参数名称
struct compact_control *cc
unsigned longlow_pfn
unsigned longend_pfn
isolate_mode_tisolate_mode
785  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 此条件成立可能性小(为编译器优化)(Similar to reclaim, but different enough that they don't share logic )循环
803  如果Async or sync migration mode 恒等于MIGRATE_ASYNC则返回: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  如果fatal_signal_pending(当前进程)则返回:0
812  cond_resched()
814  如果False from kcompactd or /proc/... Async or sync migration mode 恒等于MIGRATE_ASYNC
815  skip_on_failure = true
816  next_skip_pfn等于block_end_pfn(low_pfn, rder a direct compactor needs )
820 low_pfn小于end_pfn循环
822  如果skip_on_failurelow_pfn大于等于next_skip_pfn
829  如果nr_isolated退出
852  low_pfn等于0
853  转到:fatal_pending
856  如果非pfn_valid_within(low_pfn)则转到:isolate_fail
858  nr_scanned自加
860  page等于pfn_to_page(low_pfn)
870  low_pfn等于end_pfn
871  转到:isolate_abort
873  valid_page等于page
892  继续下一循环
902  如果PageCompound(page)则
903  order等于compound_order(page)
907  转到:isolate_fail
915  如果非PageLRU(page)则
932  转到:isolate_fail
940  如果非page_mapping(page)且page_count(page)大于page_mapcount(page)则转到:isolate_fail
948  如果非gfp mask of a direct compactor 按位与__GFP_FS的值且page_mapping(page)则转到:isolate_fail
952  如果非locked
957  如果非skip_updated
958  skip_updated = true
959  如果test_and_set_skip(cc, page, low_pfn)则转到:isolate_abort
964  如果非PageLRU(page)则转到:isolate_fail
978  lruvec等于mem_cgroup_page_lruvec(page, pgdat)
981  如果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则转到: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  添加链表项
993  Number of pages to migrate 自加
994  nr_isolated自加
1004  low_pfn先自加
1005  退出
1008  继续下一循环
1009  isolate_fail :
1010  如果非skip_on_failure则继续下一循环
1018  如果nr_isolated
1019  如果locked
1025  nr_isolated等于0
1028  如果low_pfn小于next_skip_pfn
1029  low_pfn等于next_skip_pfn减1
1034  next_skip_pfn加等于1UL左移rder a direct compactor needs
1042  如果此条件成立可能性小(为编译器优化)(low_pfn > end_pfn)则low_pfn等于end_pfn
1045  isolate_abort :
1046  如果lockedspin_unlock_irqrestore( & Write-intensive fields used by page reclaim , flags)
1057  如果low_pfn恒等于end_pfn且非nr_isolatedRescanning the same pageblock 的值则
1058  如果valid_page且非skip_updatedset_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  如果nr_isolatedcount_compact_events(COMPACTISOLATED, nr_isolated)
1071  返回:low_pfn
调用者
名称描述
isolate_migratepages_rangesolate_migratepages_range() - isolate migrate-able pages in a PFN range*@cc: Compaction control structure