函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:try_to_free_mem_cgroup_pages

函数原型:unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg, unsigned long nr_pages, gfp_t gfp_mask, bool may_swap)

返回类型:unsigned long

参数:

类型参数名称
struct mem_cgroup *memcg
unsigned longnr_pages
gfp_tgfp_mask
boolmay_swap
3349  struct scan_control sc = { How many pages shrink_list() should reclaim = 两数取大(nr_pages, SWAP_CLUSTER_MAX), This context's GFP mask = (Applies per-task gfp context to the given allocation flags.* PF_MEMALLOC_NOIO implies GFP_NOIO* PF_MEMALLOC_NOFS implies GFP_NOFS* PF_MEMALLOC_NOCMA implies no allocation from CMA region. & The set of flags that only affect watermark checking and reclaim* behaviour. This is used by the MM to obey the caller constraints* about IO, FS and watermark checking while ignoring placement* hints such as HIGHMEM usage.) | (GFP_HIGHUSER_MOVABLE & ~The set of flags that only affect watermark checking and reclaim* behaviour. This is used by the MM to obey the caller constraints* about IO, FS and watermark checking while ignoring placement* hints such as HIGHMEM usage.), The highest zone to isolate pages for reclaim from = MAX_NR_ZONES - 1, * The memory cgroup that hit its limit and as a result is the * primary target of this reclaim invocation. = memcg, 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., Writepage batching in laptop mode; RECLAIM_WRITE = !Flag that puts the machine in "laptop mode". Doubles as a timeout in jiffies:* a full sync is triggered after this time elapses without any disk activity., Can mapped pages be reclaimed? = 1, Can pages be swapped as part of reclaim? = may_swap, }
3365  zonelist等于We get the zone list from the current node and the gfp_mask.* This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones.* There are two zonelists per node, one for all zones with memory and
3367  set_task_reclaim_state(当前进程, & for recording the reclaimed slab by now )
3369  trace_mm_vmscan_memcg_reclaim_begin(0, This context's GFP mask )
3371  psi_memstall_enter - mark the beginning of a memory stall section*@flags: flags to handle nested sections* Marks the calling task as being stalled due to a lack of memory,* such as waiting for a refault or performing reclaim.
3372  noreclaim_flag等于memalloc_noreclaim_save()
3374  nr_reclaimed等于This is the main entry point to direct page reclaim
3376  memalloc_noreclaim_restore(noreclaim_flag)
3377  psi_memstall_leave - mark the end of an memory stall section*@flags: flags to handle nested memdelay sections* Marks the calling task as no longer stalled due to lack of memory.
3379  trace_mm_vmscan_memcg_reclaim_end(nr_reclaimed)
3380  set_task_reclaim_state(当前进程, NULL)
3382  返回:nr_reclaimed
调用者
名称描述
reclaim_high
try_charge
mem_cgroup_resize_max
mem_cgroup_force_emptyReclaims as many pages from the given memcg as possible.* Caller is responsible for holding css reference for memcg.
memory_high_write
memory_max_write