Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\debugobjects.c Create Date:2022-07-28 06:55:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__free_object

Proto:static void __free_object(struct debug_obj *obj)

Type:void

Parameter:

TypeParameterName
struct debug_obj *obj
345  lookahead_count = 0
349  local_irq_save(flags)
350  If Not obj_cache Then Go to free_to_obj_pool
356  percpu_pool = this_cpu_ptr( & percpu_obj_pool)
357  If obj_free < ODEBUG_POOL_PERCPU_SIZE Then
358  hlist_add_head( & node, & free_objs)
359  obj_free++
360  local_irq_restore(flags)
361  Return
368  When lookahead_count < ODEBUG_BATCH_SIZE cycle
369  objs[lookahead_count] = Allocate a new object from the hlist
370  If Not objs[lookahead_count] Then Break
372  obj_free--
375  free_to_obj_pool :
376  raw_spin_lock( & pool_lock)
377  work = obj_pool_free > debug_objects_pool_size && obj_cache && The 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  If work Then
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  If lookahead_count Then
387  When lookahead_count cycle
400  When i < ODEBUG_BATCH_SIZE cycle
407  Else
408  WRITE_ONCE(obj_pool_free, obj_pool_free + 1)
409  hlist_add_head( & node, & obj_pool)
410  If lookahead_count Then
413  When lookahead_count cycle
419  raw_spin_unlock( & pool_lock)
420  local_irq_restore(flags)
Caller
NameDescribe
free_objectPut the object back into the pool and schedule work to free objects* if necessary.