函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:shrink_slab_memcg

函数原型:static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg, int priority)

返回类型:unsigned long

参数:

类型参数名称
gfp_tgfp_mask
intnid
struct mem_cgroup *memcg
intpriority
562  freed等于0
565  如果非mem_cgroup_online(memcg)则返回:0
568  如果非rylock for reading -- returns 1 if successful, 0 if contention则返回:0
571  map等于cu_dereference_protected() - fetch RCU pointer when updates prevented*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Return the value of the specified RCU-protected pointer, but omit(shrinker_map, true)
573  如果此条件成立可能性小(为编译器优化)(!map)则转到:unlock
577  struct shrink_control sc = {gfp_mask = gfp_mask, current node being shrunk (for NUMA aware shrinkers) = nid, current memcg being shrunk (for memcg aware shrinkers) = memcg, }
584  shrinker等于dr_find() - Return pointer for given ID
585  如果此条件成立可能性小(为编译器优化)(!shrinker || shrinker == We allow subsystems to populate their shrinker-related* LRU lists before register_shrinker_prepared() is called* for the shrinker, since we don't want to impose* restrictions on their internal registration order)则
586  如果非shrinkerlear_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).
588  继续下一循环
592  如果非memcg_kmem_enabled()且非flags按位与It just makes sense when the shrinker is also MEMCG_AWARE for now,* non-MEMCG_AWARE shrinker should not have this flag set.的值则继续下一循环
596  ret等于do_shrink_slab( & sc, shrinker, priority)
597  如果ret恒等于SHRINK_EMPTY
598  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).
614  smp_mb__after_atomic()
615  ret等于do_shrink_slab( & sc, shrinker, priority)
616  如果ret恒等于SHRINK_EMPTYret等于0
618  否则memcg_set_shrinker_bit(memcg, nid, i)
621  freed加等于ret
623  如果This is the same regardless of which rwsem implementation that is being used.* It is just a heuristic meant to be called by somebody alreadying holding the* rwsem to see if somebody from an incompatible type is wanting access to the* lock.
624  freed等于如果freed否则1
625  退出
628  unlock :
629  lease a read lock
630  返回:freed
调用者
名称描述
shrink_slabshrink_slab - shrink slab caches*@gfp_mask: allocation context*@nid: node whose slab caches to target*@memcg: memory cgroup whose slab caches to target*@priority: the reclaim priority* Call the shrink functions to age shrinkable caches