函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Memory pool allocation and freeing. kmemleak_lock must not be held.

函数原型:static struct kmemleak_object *mem_pool_alloc(gfp_t gfp)

返回类型:struct kmemleak_object

参数:

类型参数名称
gfp_tgfp
422  如果allocation caches for kmemleak internal data
423  object等于分配高速缓存区
424  如果object则返回:object
429  write_lock_irqsave( & w_lock protecting the access to object_list and object_tree_root , flags)
430  object等于list_first_entry_or_null - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.( & mem_pool_free_list, typeof( * object), he list of all allocated objects )
432  如果object删除链表项
434  否则如果mem_pool_free_countobject等于memory pool allocation [--mem_pool_free_count]
436  否则pr_warn_once("Memory pool empty, consider increasing CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE\n")
438  write_unlock_irqrestore( & w_lock protecting the access to object_list and object_tree_root , flags)
440  返回:object
调用者
名称描述
create_objectCreate the metadata (struct kmemleak_object) corresponding to an allocated* memory block and add it to the object_list and object_tree_root.