Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Move the free pages in a range to the free lists of the requested type.* Note that start_page and end_pages are not aligned on a pageblock* boundary. If alignment is required, use move_freepages_block()

Proto:static int move_freepages(struct zone *zone, struct page *start_page, struct page *end_page, int migratetype, int *num_movable)

Type:int

Parameter:

TypeParameterName
struct zone *zone
struct page *start_page
struct page *end_page
intmigratetype
int *num_movable
2243  pages_moved = 0
2245  When page <= end_page cycle
2246  If Not pfn_valid_within(page_to_pfn(page)) Then
2247  page++
2248  Continue
2257  If num_movable && (PageLRU(page) || __PageMovable(page)) Then num_movable++
2261  page++
2262  Continue
2266  VM_BUG_ON_PAGE(page_to_nid(page) != zone_to_nid(zone), page)
2267  VM_BUG_ON_PAGE(page_zone(page) != zone, page)
2269  order = page_order(page)
2270  Used for pages which are on another list
2271  page += 1 << order
2272  pages_moved += 1 << order
2275  Return pages_moved
Caller
NameDescribe
move_freepages_block