Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This function checks whether pageblock includes unmovable pages or not.* If @count is not zero, it is okay to include less @count unmovable pages* PageLRU check without isolation or lru_lock could race so that

Proto:bool has_unmovable_pages(struct zone *zone, struct page *page, int count, int migratetype, int flags)

Type:bool

Parameter:

TypeParameterName
struct zone *zone
struct page *page
intcount
intmigratetype
intflags
8178  iter = 0
8179  pfn = page_to_pfn(page)
8180  reason = "unmovable page"
8190  If is_migrate_cma_page(page) Then
8196  If is_migrate_cma(migratetype) Then Return false
8199  reason = "CMA page"
8200  Go to unmovable
8203  When iter < pageblock_nr_pages cycle
8204  check = pfn + iter
8206  If Not pfn_valid_within(check) Then Continue
8209  page = pfn_to_page(check)
8211  If PageReserved(page) Then Go to unmovable
8219  If zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc.(zone) == ZONE_MOVABLE Then Continue
8227  If PageHuge(page) Then
8228  head = compound_head(page)
8235  iter += skip_pages - 1
8236  Continue
8245  If Not page_ref_count(page) Then
8248  Continue
8255  If flags & MEMORY_OFFLINE && PageHWPoison(page) Then Continue
8258  If __PageMovable(page) Then Continue
8261  If Not PageLRU(page) Then found++
8276  If found > count Then Go to unmovable
8279  Return false
8280  unmovable :
8281  WARN_ON_ONCE(zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc.(zone) == ZONE_MOVABLE)
8282  If flags & REPORT_FAILURE Then dump_page(pfn_to_page(pfn + iter), reason)
8284  Return true
Caller
NameDescribe
set_migratetype_isolate