函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__free_object

函数原型:static void __free_object(struct debug_obj *obj)

返回类型:void

参数:

类型参数名称
struct debug_obj *obj
345  lookahead_count等于0
349  local_irq_save(flags)
350  如果非obj_cache则转到:free_to_obj_pool
356  percpu_pool等于this_cpu_ptr( & percpu_obj_pool)
357  如果obj_free小于ODEBUG_POOL_PERCPU_SIZE
358  hlist_add_head( & node, & free_objs)
359  obj_free自加
360  local_irq_restore(flags)
361  返回
368 lookahead_count小于ODEBUG_BATCH_SIZE循环
369  objs[lookahead_count]等于Allocate a new object from the hlist
370  如果非objs[lookahead_count]则退出
372  obj_free自减
375  free_to_obj_pool :
376  raw_spin_lock( & pool_lock)
377  work等于obj_pool_free大于debug_objects_pool_sizeobj_cacheThe number of objs on the global free list 小于We limit the freeing of debug objects via workqueue at a maximum* frequency of 10Hz and about 1024 objects for each freeing operation.* So it is freeing at most 10k debug objects per second.
379  obj_pool_used自减
381  如果work
382  WRITE_ONCE(The number of objs on the global free list , The number of objs on the global free list + 1)
383  hlist_add_head( & node, & obj_to_free)
384  如果lookahead_count
400 i小于ODEBUG_BATCH_SIZE循环
407  否则
408  WRITE_ONCE(obj_pool_free, obj_pool_free + 1)
409  hlist_add_head( & node, & obj_pool)
410  如果lookahead_count
419  raw_spin_unlock( & pool_lock)
420  local_irq_restore(flags)
调用者
名称描述
free_objectPut the object back into the pool and schedule work to free objects* if necessary.