Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This function implements actual steal behaviour. If order is large enough,* we can steal whole pageblock. If not, we first move freepages in this* pageblock to our migratetype and determine how many already-allocated pages

Proto:static void steal_suitable_fallback(struct zone *zone, struct page *page, unsigned int alloc_flags, int start_type, bool whole_block)

Type:void

Parameter:

TypeParameterName
struct zone *zone
struct page *page
unsigned intalloc_flags
intstart_type
boolwhole_block
2385  current_order = page_order(page)
2390  old_block_type = get_pageblock_migratetype(page)
2396  If is_migrate_highatomic(old_block_type) Then Go to single_page
2400  If current_order >= Huge pages are a constant size Then
2401  change_pageblock_range(page, current_order, start_type)
2402  Go to single_page
2410  boost_watermark(zone)
2411  If alloc_flags & allow waking of kswapd Then Atomically set a bit in memory
2415  If Not whole_block Then Go to single_page
2418  free_pages = move_freepages_block(zone, page, start_type, & movable_pages)
2425  If start_type == MIGRATE_MOVABLE Then
2426  alike_pages = movable_pages
2427  Else
2435  If old_block_type == MIGRATE_MOVABLE Then alike_pages = pageblock_nr_pages - free_pages + movable_pages
2438  Else alike_pages = 0
2443  If Not free_pages Then Go to single_page
2450  If free_pages + alike_pages >= 1 << Huge pages are a constant size - 1 || page_group_by_mobility_disabled Then set_pageblock_migratetype(page, start_type)
2454  Return
2456  single_page :
2457  area = Write-intensive fields used from the page allocator [current_order]
2458  Used for pages which are on another list
Caller
NameDescribe
__rmqueue_fallbackTry finding a free buddy page on the fallback list and put it on the free* list of requested migratetype, possibly along with other pages from the same* block, depending on fragmentation avoidance heuristics. Returns true if