函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:This is the main entry point to direct page reclaim

函数原型:static unsigned long do_try_to_free_pages(struct zonelist *zonelist, struct scan_control *sc)

返回类型:unsigned long

参数:

类型参数名称
struct zonelist *zonelist
struct scan_control *sc
3038  initial_priority等于 Scan (total_size >> priority) pages at once
3042  retry :
3043  delayacct_freepages_start()
3045  如果非cgroup_reclaim(sc)则__count_zid_vm_events(ALLOCSTALL, The highest zone to isolate pages for reclaim from , 1)
3048  循环
3049  vmpressure_prio( This context's GFP mask , * The memory cgroup that hit its limit and as a result is the * primary target of this reclaim invocation., Scan (total_size >> priority) pages at once )
3051  Incremented by the number of inactive pages that were scanned 等于0
3052  This is the direct reclaim path, for page-allocating processes. We only* try to reclaim pages from zones which will satisfy the caller's allocation* request.* If a zone is deemed to be full of pinned pages then just give it a light
3054  如果 Number of pages freed so far during a call to shrink_zones() 大于等于 How many pages shrink_list() should reclaim 退出
3057  如果 One of the zones is ready for compaction 退出
3064  如果 Scan (total_size >> priority) pages at once 小于The "priority" of VM scanning is how much of the queues we will scan in one* go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the* queues ("queue_length >> 12") during an aging round.减2则 Writepage batching in laptop mode; RECLAIM_WRITE 等于1
3066  Scan (total_size >> priority) pages at once 先自减大于等于0循环
3068  last_pgdat = NULL
3071  如果建立内存域和父结点之间的关联恒等于last_pgdat则继续下一循环
3073  last_pgdat等于建立内存域和父结点之间的关联
3075  snapshot_refaults(* The memory cgroup that hit its limit and as a result is the * primary target of this reclaim invocation., 建立内存域和父结点之间的关联)
3077  如果cgroup_reclaim(sc)则
3080  lruvec等于mem_cgroup_lruvec - get the lru list vector for a memcg & node*@memcg: memcg of the wanted lruvec* Returns the lru list vector holding pages for a given @memcg &*@node combination. This can be the node lruvec, if the memory* controller is disabled.
3082  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
3086  delayacct_freepages_end()
3088  如果 Number of pages freed so far during a call to shrink_zones() 则返回: Number of pages freed so far during a call to shrink_zones()
3092  如果 One of the zones is ready for compaction 则返回:1
3104  如果skipped_deactivate
3105  Scan (total_size >> priority) pages at once 等于initial_priority
3106  force_deactivate等于1
3107  skipped_deactivate等于0
3108  转到:retry
3112  如果memcg_low_skipped
3113  Scan (total_size >> priority) pages at once 等于initial_priority
3114  force_deactivate等于0
3115  skipped_deactivate等于0
3116  * Cgroups are not reclaimed below their configured memory.low, * unless we threaten to OOM. If any cgroups are skipped due to * memory.low and nothing was reclaimed, go back for memory.low.等于1
3117  memcg_low_skipped等于0
3118  转到:retry
3121  返回:0
调用者
名称描述
try_to_free_pages
try_to_free_mem_cgroup_pages