Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:set_migratetype_isolate

Proto:static int set_migratetype_isolate(struct page *page, int migratetype, int isol_flags)

Type:int

Parameter:

TypeParameterName
struct page *page
intmigratetype
intisol_flags
24  ret = -EBUSY
26  zone = page_zone(page)
28  spin_lock_irqsave( & Primarily protects free_area , flags)
35  If is_migrate_isolate_page(page) Then Go to out
38  pfn = page_to_pfn(page)
39  Start of range to check = pfn
40  # pages in range to check = pageblock_nr_pages
41  # pages owned found by callbacks = 0
54  notifier_ret = memory_isolate_notify(During pageblock isolation, count the number of pages within the* range [start_pfn, start_pfn + nr_pages) which are owned by code* in the notifier chain., & arg)
55  notifier_ret = Restore (negative) errno value from notify return value.
56  If notifier_ret Then Go to out
62  If Not 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 Then ret = 0
71  out :
72  If Not ret Then
74  mt = get_pageblock_migratetype(page)
76  set_pageblock_migratetype(page, MIGRATE_ISOLATE)
77  * Number of isolated pageblock. It is used to solve incorrect * freepage counting problem due to racy retrieving migratetype * of pageblock. Protected by zone->lock.++
78  nr_pages = move_freepages_block(zone, page, MIGRATE_ISOLATE, NULL)
81  __mod_zone_freepage_state(zone, - nr_pages, mt)
84  spin_unlock_irqrestore( & Primarily protects free_area , flags)
85  If Not ret Then Spill all the per-cpu pages from all CPUs back into the buddy allocator.* When zone parameter is non-NULL, spill just the single zone's pages.* Note that this can be extremely slow as the draining happens in a workqueue.
87  Return ret
Caller
NameDescribe
start_isolate_page_rangestart_isolate_page_range() - make page-allocation-type of range of pages to* be MIGRATE_ISOLATE.*@start_pfn: The lower PFN of the range to be isolated.*@end_pfn: The upper PFN of the range to be isolated.