函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Return true if free base pages are above 'mark'. For high-order checks it* will return true of the order-0 watermark is reached and there is at least* one free page of a suitable size. Checking now avoids taking the zone lock

函数原型:bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, int classzone_idx, unsigned int alloc_flags, long free_pages)

返回类型:bool

参数:

类型参数名称
struct zone *z
unsigned intorder
unsigned longmark
intclasszone_idx
unsigned intalloc_flags
longfree_pages
3394  min等于mark
3396  alloc_harder等于alloc_flags按位与ry to alloc harder 按位或Only MMU archs have async oom victim reclaim - aka oom_reaper so we* cannot assume a reduced access to memory reserves is sufficient for* !MMU的值
3399  free_pages减等于1左移order位的值减1
3401  如果alloc_flags按位与__GFP_HIGH set min减等于min除2
3409  如果此条件成立可能性大(为编译器优化)(!alloc_harder)则
3410  free_pages减等于nr_reserved_highatomic
3411  否则
3418  如果alloc_flags按位与Only MMU archs have async oom victim reclaim - aka oom_reaper so we* cannot assume a reduced access to memory reserves is sufficient for* !MMUmin减等于min除2
3420  否则min减等于min除4
3427  如果非alloc_flags按位与allow allocations from CMA areas 的值则free_pages减等于zone_page_state(z, NR_FREE_CMA_PAGES)
3436  如果free_pages小于等于min关键性内存分配[classzone_idx]则返回:false
3440  如果非order则返回:true
3444 o小于Free memory management - zoned buddy allocator. 循环
3445  area等于伙伴系统空闲内存页[o]
3448  如果非nr_free则继续下一循环
3451 mt小于MIGRATE_PCPTYPES循环
3452  如果非free_area_empty(area, mt)则返回:true
3459  返回:true
3462  如果alloc_harder且非链表为空则返回:true
3466  返回:false
调用者
名称描述
zone_watermark_ok
zone_watermark_fast
zone_watermark_ok_safe
should_reclaim_retryChecks whether it makes sense to retry the reclaim to make a forward progress* for the given allocation request.* We give up when we either have tried MAX_RECLAIM_RETRIES in a row* without success, or when we couldn't even meet the watermark if we