函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mem_cgroup_soft_limit_reclaim

函数原型:unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, gfp_t gfp_mask, unsigned long *total_scanned)

返回类型:unsigned long

参数:

类型参数名称
pg_data_t *pgdat
intorder
gfp_tgfp_mask
unsigned long *total_scanned
3047  nr_reclaimed等于0
3048  struct mem_cgroup_per_node * mz, * next_mz = NULL
3050  loop等于0
3055  如果order大于0则返回:0
3058  mctz等于soft_limit_tree_node(全局结点ID)
3065  如果非mctzRB_EMPTY_ROOT( & rb_root)则返回:0
3073  循环
3074  如果next_mzmz等于next_mz
3076  否则mz等于mem_cgroup_largest_soft_limit_node(mctz)
3078  如果非mz退出
3081  nr_scanned等于0
3082  reclaimed等于mem_cgroup_soft_reclaim(Back pointer, we cannot , pgdat, gfp_mask, & nr_scanned)
3084  nr_reclaimed加等于reclaimed
3085  total_scanned加等于nr_scanned
3086  spin_lock_irq( & lock)
3087  __mem_cgroup_remove_exceeded(mz, mctz)
3093  next_mz = NULL
3094  如果非reclaimednext_mz等于__mem_cgroup_largest_soft_limit_node(mctz)
3097  excess等于soft_limit_excess(Back pointer, we cannot )
3107  __mem_cgroup_insert_exceeded(mz, mctz, excess)
3108  spin_unlock_irq( & lock)
3109  设置一个css引用
3110  loop自加
3116  如果非nr_reclaimednext_mz恒等于NULLloop大于MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS的值则退出
3120  当非nr_reclaimed循环
3121  如果next_mz设置一个css引用
3123  返回:nr_reclaimed
调用者
名称描述
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.
shrink_zonesThis 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