函数逻辑报告 |
Source Code:mm\compaction.c |
Create Date:2022-07-27 15:55:43 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称: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 long | low_pfn | |
unsigned long | end_pfn | |
isolate_mode_t | isolate_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 |
792 | bool skip_on_failure = false |
793 | next_skip_pfn等于0 |
794 | bool skip_updated = false |
803 | 如果Async or sync migration mode 恒等于MIGRATE_ASYNC则返回:0 |
808 | 如果fatal_signal_pending(当前进程)则返回:0 |
812 | cond_resched() |
815 | skip_on_failure = true |
822 | 如果skip_on_failure且low_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) |
868 | 如果非valid_page且IS_ALIGNED(low_pfn, pageblock_nr_pages)则 |
871 | 转到:isolate_abort |
873 | valid_page等于page |
883 | freepage_order等于Like page_order(), but for callers who cannot afford to hold the zone lock(page) |
890 | 如果freepage_order大于0且freepage_order小于Free memory management - zoned buddy allocator. 则low_pfn加等于1UL左移freepage_order位的值减1 |
892 | 继续下一循环 |
902 | 如果PageCompound(page)则 |
903 | order等于compound_order(page) |
905 | 如果此条件成立可能性大(为编译器优化)(order < Free memory management - zoned buddy allocator. )则low_pfn加等于1UL左移order位的值减1 |
907 | 转到:isolate_fail |
920 | 如果此条件成立可能性小(为编译器优化)(__PageMovable(page))且非PageIsolated(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 |
972 | 如果此条件成立可能性小(为编译器优化)(PageCompound(page))则 |
978 | lruvec等于mem_cgroup_page_lruvec(page, pgdat) |
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.) |
991 | isolate_success : |
992 | 添加链表项 |
993 | Number of pages to migrate 自加 |
994 | nr_isolated自加 |
1008 | 继续下一循环 |
1009 | isolate_fail : |
1010 | 如果非skip_on_failure则继续下一循环 |
1018 | 如果nr_isolated则 |
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 : |
1057 | 如果low_pfn恒等于end_pfn且非nr_isolated或Rescanning the same pageblock 的值则 |
1060 | update_cached_migrate(cc, low_pfn) |
1066 | fatal_pending : |
1067 | total_migrate_scanned加等于nr_scanned |
1071 | 返回:low_pfn |
名称 | 描述 |
---|---|
isolate_migratepages_range | solate_migratepages_range() - isolate migrate-able pages in a PFN range*@cc: Compaction control structure |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |