函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Try to free up some pages from this node through reclaim.

函数原型:static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)

返回类型:int

参数:

类型参数名称
struct pglist_data *pgdat
gfp_tgfp_mask
unsigned intorder
4204  nr_pages等于1左移order
4205  p等于当前进程
4207  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., Allocation order = order, Scan (total_size >> priority) pages at once = Priority for NODE_RECLAIM. This determines the fraction of pages* of a node considered for each zone_reclaim. 4 scans 1/16th of* a zone., Writepage batching in laptop mode; RECLAIM_WRITE = !!(Node reclaim mode* If non-zero call node_reclaim when the number of free pages falls below* the watermarks. & Writeout pages during reclaim ), Can mapped pages be reclaimed? = !!(Node reclaim mode* If non-zero call node_reclaim when the number of free pages falls below* the watermarks. & Unmap pages during reclaim ), Can pages be swapped as part of reclaim? = 1, The highest zone to isolate pages for reclaim from = gfp_zone(gfp_mask), }
4218  trace_mm_vmscan_node_reclaim_begin(全局结点ID, order, This context's GFP mask )
4221  cond_resched()
4222  fs_reclaim_acquire( This context's GFP mask )
4228  noreclaim_flag等于memalloc_noreclaim_save()
4229  flags或等于Allowed to write to swap
4230  set_task_reclaim_state(p, & for recording the reclaimed slab by now )
4232  如果Work out how many page cache pages we can reclaim in this reclaim_mode 大于* zone reclaim becomes active if more unmapped pages exist.
4237  循环
4238  shrink_node(pgdat, & sc)
4239  Number of pages freed so far during a call to shrink_zones() 小于nr_pages Scan (total_size >> priority) pages at once 先自减大于等于0循环
4242  set_task_reclaim_state(p, NULL)
4243  flags与等于Allowed to write to swap 的反
4244  memalloc_noreclaim_restore(noreclaim_flag)
4245  fs_reclaim_release( This context's GFP mask )
4247  trace_mm_vmscan_node_reclaim_end( Number of pages freed so far during a call to shrink_zones() )
4249  返回: Number of pages freed so far during a call to shrink_zones() 大于等于nr_pages
调用者
名称描述
node_reclaim