函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmscan.c Create Date:2022-07-27 15:43:26
Last Modify:2022-05-23 13:41:30 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:allow_direct_reclaim

函数原型:static bool allow_direct_reclaim(pg_data_t *pgdat)

返回类型:bool

参数:

类型参数名称
pg_data_t *pgdat
3127  pfmemalloc_reserve等于0
3128  free_pages等于0
3132  如果 Number of 'reclaimed == 0' runs 大于等于Maximum number of reclaim retries without progress before the OOM* killer is consider the only way forward.则返回:true
3135 i小于等于标记为可直接映射的内核段的普通内存域循环
3136  zone等于包含了结点中各内存域的数据结构[i]
3137  如果非Returns true if a zone has pages managed by the buddy allocator.* All the reclaim decisions have to use this function rather than* populated_zone(). If the whole zone is reserved then we can easily* end up with populated_zone() && !managed_zone().则继续下一循环
3140  如果非This misses isolated pages which are not accounted for to save counters.* As the data only determines if reclaim or compaction continues, it is* not expected that isolated pages will be a dominating factor.则继续下一循环
3143  pfmemalloc_reserve加等于min_wmark_pages(zone)
3144  free_pages加等于zone_page_state(zone, NR_FREE_PAGES)
3148  如果非pfmemalloc_reserve则返回:true
3151  wmark_ok等于free_pages大于pfmemalloc_reserve除2
3154  如果非wmark_okwaitqueue_active -- locklessly test for waiters on the queue*@wq_head: the waitqueue to test for waiters* returns true if the wait list is not empty* NOTE: this function is lockless and requires care, incorrect usage _will_
3155  kswapd_classzone_idx等于两数取小(kswapd_classzone_idx, (enumzone_type)标记为可直接映射的内核段的普通内存域)
3157  wake_up_interruptible( & 交换守护进程的等待队列)
3160  返回:wmark_ok
调用者
名称描述
throttle_direct_reclaimThrottle direct reclaimers if backing storage is backed by the network* and the PFMEMALLOC reserve for the preferred node is getting dangerously* depleted. kswapd will continue to make progress and wake the processes* when the low watermark is reached.
balance_pgdatFor kswapd, balance_pgdat() will reclaim pages across a node from zones* that are eligible for use by the caller until at least one zone is* balanced.* Returns the order kswapd finished reclaiming at.