函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Frees a number of pages from the PCP lists* Assumes all pages on list are in same zone, and of same order.* count is the number of pages to free.* If the zone was previously in an "all pages pinned" state then look to

函数原型:static void free_pcppages_bulk(struct zone *zone, int count, struct per_cpu_pages *pcp)

返回类型:void

参数:

类型参数名称
struct zone *zone
intcount
struct per_cpu_pages *pcp
1252  migratetype等于0
1253  batch_free等于0
1254  prefetch_nr等于0
1257  LIST_HEAD(head)
1259 count循环
1269  循环
1270  batch_free自加
1271  如果migratetype先自加恒等于MIGRATE_PCPTYPESmigratetype等于0
1274 链表为空循环
1277  如果batch_free恒等于MIGRATE_PCPTYPESbatch_free等于count
1280  循环
1286  如果bulkfree_pcp_prepare(page)则继续下一循环
1302 count先自减且batch_free先自减且非链表为空循环
1305  加自旋锁
1306  isolated_pageblocks等于has_isolate_pageblock(zone)
1313  mt等于A cached value of the page's pageblock's migratetype, used when the page is* put on a pcplist
1315  VM_BUG_ON_PAGE(is_migrate_isolate(mt), page)
1317  如果此条件成立可能性小(为编译器优化)(isolated_pageblocks)则mt等于get_pageblock_migratetype(page)
1320  Freeing function for a buddy system allocator
1321  trace_mm_page_pcpu_drain(page, 0, mt)
1323  自旋锁解锁
调用者
名称描述
drain_zone_pagesCalled from the vmstat counter updater to drain pagesets of this* currently executing processor on remote nodes after they have* expired.* Note that this function must be called with the thread pinned to* a single processor.
drain_pages_zoneDrain pcplists of the indicated processor and zone.* The processor must either be the current processor and the* thread pinned to the current processor or a processor that* is not online.
free_unref_page_commit