函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-27 17:17:33
Last Modify:2022-05-23 17:02:55 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:setup_kmem_cache_node

函数原型:static int setup_kmem_cache_node(struct kmem_cache *cachep, int node, gfp_t gfp, bool force_change)

返回类型:int

参数:

类型参数名称
struct kmem_cache *cachep
intnode
gfp_tgfp
boolforce_change
923  ret等于负ENOMEM
925  struct array_cache * old_shared = NULL
926  struct array_cache * new_shared = NULL
927  struct alien_cache * * new_alien = NULL
928  LIST_HEAD(list)
930  如果By default on NUMA we use alien caches to stage the freeing of* objects allocated from other nodes
931  new_alien等于alloc_alien_cache(node, limit, gfp)
932  如果非new_alien则转到:fail
936  如果shared
937  new_shared等于alloc_arraycache(node, shared * batchcount, 0xbaadf00d, gfp)
939  如果非new_shared则转到:fail
943  ret等于init_cache_node(cachep, node, gfp)
944  如果ret则转到:fail
947  n等于get_node(cachep, node)
948  spin_lock_irq( & list_lock)
949  如果sharedforce_change
950  Caller needs to acquire correct kmem_cache_node's list_lock*@list: List of detached free slabs should be freed by caller
952  avail等于0
955  如果非sharedforce_change
956  old_shared等于shared
957  shared等于new_shared
958  new_shared = NULL
961  如果非alien
962  alien等于new_alien
963  new_alien = NULL
966  spin_unlock_irq( & list_lock)
967  slabs_destroy(cachep, & list)
975  如果old_sharedforce_changeWait for a grace period to elapse. But it is illegal to invoke* synchronize_rcu() from within an RCU read-side critical section.* Therefore, any legal call to synchronize_rcu() is a quiescent
978  fail :
979  释放内存
980  释放内存
981  free_alien_cache(new_alien)
983  返回:ret
调用者
名称描述
setup_kmem_cache_nodesThis initializes kmem_cache_node or resizes various caches for all nodes.