函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Checks 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

函数原型:static inline bool should_reclaim_retry(gfp_t gfp_mask, unsigned order, struct alloc_context *ac, int alloc_flags, bool did_some_progress, int *no_progress_loops)

返回类型:bool

参数:

类型参数名称
gfp_tgfp_mask
unsignedorder
struct alloc_context *ac
intalloc_flags
booldid_some_progress
int *no_progress_loops
4272  bool ret = false
4279  如果did_some_progressorder小于等于PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed* costly to service. That is between allocation orders which should* coalesce naturally under reasonable reclaim pressure and those which* will not.no_progress_loops等于0
4281  否则no_progress_loops自加
4288  如果no_progress_loops大于Maximum number of reclaim retries without progress before the OOM* killer is consider the only way forward.
4290  返回:Used when an allocation is about to fail under memory pressure
4303  min_wmark等于min_wmark_pages(zone)
4306  available等于reclaimable等于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.
4307  available加等于More accurate version that also considers the currently pending* deltas. For that we need to loop over all cpus to find the current* deltas. There is no synchronization so the result cannot be* exactly accurate either.
4313  wmark等于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
4315  trace_reclaim_retry_zone(z, order, reclaimable, available, min_wmark, * no_progress_loops, wmark)
4317  如果wmark
4324  如果非did_some_progress
4336  ret = true
4337  转到:out
4341  out :
4349  如果flags按位与进程处于工作队列中schedule_timeout_uninterruptible(1)
4351  否则cond_resched()
4353  返回:ret
调用者
名称描述
__alloc_pages_slowpath