函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:free_pages_prepare

函数原型:static __always_inline bool free_pages_prepare(struct page *page, unsigned int order, bool check_free)

返回类型:bool

参数:

类型参数名称
struct page *page
unsigned intorder
boolcheck_free
1124  bad等于0
1126  VM_BUG_ON_PAGE(PageTail(page), page)
1128  trace_mm_page_free(page, order)
1134  如果此条件成立可能性小(为编译器优化)(order)则
1135  compound等于PageCompound(page)
1138  VM_BUG_ON_PAGE(compound && compound_order(page) != order, page)
1140  如果compoundClearPageDoubleMap(page)
1142 i小于1左移order循环
1143  如果compoundbad加等于free_tail_pages_check(page, page + i)
1146  bad自加
1147  继续下一循环
1152  如果PageMappingFlags(page)则 See page-flags.h for PAGE_MAPPING_FLAGS = NULL
1154  如果memcg_kmem_enabled()且If kmemcg is enabled, the buddy allocator will set PageKmemcg() on* pages allocated with __GFP_ACCOUNT. It gets cleared on page free.__memcg_kmem_uncharge(page, order)
1156  如果check_freebad加等于free_pages_check(page)
1158  如果bad则返回:false
1161  page_cpupid_reset_last(page)
1162  体系结构无关页的属性与等于Flags checked when a page is prepped for return by the page allocator的反
1163  reset_page_owner(page, order)
1165  如果非PageHighMem(page)则
1166  Called when kernel memory is freed (or unmapped), or if a lock* is destroyed or reinitialized - this code checks whether there is* any held lock in the memory range of to :
1168  debug_check_no_obj_freed(page_address(page), PAGE_SIZE << order)
1171  如果want_init_on_free()则kernel_init_free_pages(page, 1 << order)
1174  kernel_poison_pages(page, 1 << order, 0)
1180  arch_free_page(page, order)
1182  如果For use in fast paths after init_debug_pagealloc() has run, or when a* false negative result is not harmful when called too early.kernel_map_pages(page, 1 << order, 0)
1185  kasan_free_nondeferred_pages(page, order)
1187  返回:true
调用者
名称描述
free_pcp_prepareWith DEBUG_VM disabled, order-0 pages being freed are checked only when* moving from pcp lists to free list in order to reduce overhead. With* debug_pagealloc enabled, they are checked also immediately when being freed* to the pcp lists.
__free_pages_ok