函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Freeing function for a buddy system allocator

函数原型:static inline void __free_one_page(struct page *page, unsigned long pfn, struct zone *zone, unsigned int order, int migratetype)

返回类型:void

参数:

类型参数名称
struct page *page
unsigned longpfn
struct zone *zone
unsigned intorder
intmigratetype
903  buddy_pfn等于buddy_pfn
906  capc等于task_capc(zone)
908  max_order等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedint, Free memory management - zoned buddy allocator. , Huge pages are a constant size + 1)
910  VM_BUG_ON(!zone_is_initialized(zone))
911  VM_BUG_ON_PAGE(体系结构无关页的属性 & Flags checked when a page is prepped for return by the page allocator, page)
913  VM_BUG_ON(migratetype == - 1)
914  如果此条件成立可能性大(为编译器优化)(!is_migrate_isolate(migratetype))则__mod_zone_freepage_state(zone, 1 << order, migratetype)
917  VM_BUG_ON_PAGE(pfn & ((1 << order) - 1), page)
918  VM_BUG_ON_PAGE(bad_range(zone, page), page)
920  continue_merging :
921 order小于max_order减1循环
925  返回
927  buddy_pfn等于Locate the struct page for both the matching buddy in our* pair (buddy1) and the combined O(n+1) page they form (page)
928  buddy等于pagebuddy_pfnpfn
930  如果非pfn_valid_within(buddy_pfn)则转到:done_merging
932  如果非This function checks whether a page is free && is the buddy* we can coalesce a page and its buddy if* (a) the buddy is not in a hole (check before calling!) &&* (b) the buddy is in the buddy system &&* (c) a page and its buddy have the same order &&则转到:done_merging
938  如果page_is_guard(buddy)则clear_page_guard(zone, buddy, order, migratetype)
940  否则del_page_from_free_area(buddy, & 伙伴系统空闲内存页[order])
942  combined_pfn等于buddy_pfn按位与pfn
943  page等于pagecombined_pfnpfn
944  pfn等于combined_pfn
945  order自加
947  如果max_order小于Free memory management - zoned buddy allocator.
960  buddy等于pagebuddy_pfnpfn
968  max_order自加
969  转到:continue_merging
972  done_merging :
973  set_page_order(page, order)
983  如果order小于Free memory management - zoned buddy allocator. 减2且pfn_valid_within(buddy_pfn)且非is_shuffle_order(order)则
986  combined_pfn等于buddy_pfn按位与pfn
987  higher_page等于pagecombined_pfnpfn
988  buddy_pfn等于Locate the struct page for both the matching buddy in our* pair (buddy1) and the combined O(n+1) page they form (page)
989  higher_buddy等于higher_pagebuddy_pfncombined_pfn
994  返回
998  如果is_shuffle_order(order)则add_to_free_area_random(page, & 伙伴系统空闲内存页[order], migratetype)
1001  否则Used for pages not on another list
调用者
名称描述
free_pcppages_bulkFrees 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
free_one_page