Function report |
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 activity | Download SCCT | Chinese |
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:
| Type | Parameter | Name |
|---|---|---|
| struct compact_control * | cc | |
| unsigned long | low_pfn | |
| unsigned long | end_pfn | |
| isolate_mode_t | isolate_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 |
| 792 | bool skip_on_failure = false |
| 793 | next_skip_pfn = 0 |
| 794 | bool skip_updated = false |
| 803 | If Async or sync migration mode == MIGRATE_ASYNC Then Return 0 |
| 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 |
| 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) |
| 868 | If Not valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages) Then |
| 869 | If Not Scan blocks even if marked skip && get_pageblock_skip(page) Then |
| 871 | Go to 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 | If freepage_order > 0 && freepage_order < Free memory management - zoned buddy allocator. Then low_pfn += (1UL << freepage_order) - 1 |
| 892 | Continue |
| 902 | If PageCompound(page) Then |
| 903 | order = compound_order(page) |
| 905 | If Value is more likely to compile time(order < Free memory management - zoned buddy allocator. ) Then low_pfn += (1UL << order) - 1 |
| 907 | Go to isolate_fail |
| 920 | If Value for the false possibility is greater at compile time(__PageMovable(page)) && Not PageIsolated(page) Then |
| 922 | If locked Then |
| 925 | locked = false |
| 928 | If Not isolate_movable_page(page, isolate_mode) Then Go to isolate_success |
| 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 |
| 974 | Go to isolate_fail |
| 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 : |
| 993 | Number of pages to migrate ++ |
| 994 | nr_isolated++ |
| 1002 | If Number of pages to migrate == COMPACT_CLUSTER_MAX && Not Rescanning the same pageblock && Not Signal lock or sched contention Then |
| 1004 | ++low_pfn |
| 1005 | Break |
| 1008 | Continue |
| 1009 | isolate_fail : |
| 1010 | If Not skip_on_failure Then Continue |
| 1018 | If nr_isolated Then |
| 1028 | If low_pfn < next_skip_pfn Then |
| 1029 | low_pfn = next_skip_pfn - 1 |
| 1034 | next_skip_pfn += 1UL << rder a direct compactor needs |
| 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) |
| 1066 | fatal_pending : |
| 1067 | total_migrate_scanned += nr_scanned |
| 1068 | If nr_isolated Then count_compact_events(COMPACTISOLATED, nr_isolated) |
| 1071 | Return low_pfn |
| Name | Describe |
|---|---|
| isolate_migratepages_range | solate_migratepages_range() - isolate migrate-able pages in a PFN range*@cc: Compaction control structure |
| 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 |