函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_isolation.c Create Date:2022-07-27 17:59:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:set_migratetype_isolate

函数原型:static int set_migratetype_isolate(struct page *page, int migratetype, int isol_flags)

返回类型:int

参数:

类型参数名称
struct page *page
intmigratetype
intisol_flags
24  ret等于负EBUSY
26  zone等于page_zone(page)
28  spin_lock_irqsave( & 自旋锁, flags)
35  如果is_migrate_isolate_page(page)则转到: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  如果notifier_ret则转到:out
62  如果非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 thatret等于0
71  out :
72  如果非ret
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( & 自旋锁, flags)
85  如果非retSpill 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  返回:ret
调用者
名称描述
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.