函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:quarantine_reduce

函数原型:void quarantine_reduce(void)

返回类型:void

参数:

218  to_free等于QLIST_INIT
220  如果此条件成立可能性大(为编译器优化)(READ_ONCE(Total size of all objects in global_quarantine across all batches. ) <= READ_ONCE(Maximum size of the global queue. ))则返回
233  srcu_idx等于srcu_read_lock - register a new reader for an SRCU-protected structure
234  raw_spin_lock_irqsave( & quarantine_lock, flags)
240  total_size等于totalram_pages()左移PAGE_SHIFT determines the page size 位的值除The fraction of physical memory the quarantine is allowed to occupy.* Quarantine doesn't support memory shrinker with SLAB allocator, so we keep* the ratio low to avoid OOM.
242  percpu_quarantines等于QUARANTINE_PERCPU_SIZEnum_online_cpus()
243  new_quarantine_size等于如果total_size小于percpu_quarantines则0否则total_sizepercpu_quarantines
245  WRITE_ONCE(Maximum size of the global queue. , new_quarantine_size)
247  WRITE_ONCE(Target size of a batch in global_quarantine.* Usually equal to QUARANTINE_PERCPU_SIZE unless we have too much RAM., 两数取大((size_t)QUARANTINE_PERCPU_SIZE, 2 * total_size / QUARANTINE_BATCHES))
250  如果此条件成立可能性大(为编译器优化)(Total size of all objects in global_quarantine across all batches. > Maximum size of the global queue. )则
251  qlist_move_all( & Round-robin FIFO array of batches. [quarantine_head], & to_free)
252  WRITE_ONCE(Total size of all objects in global_quarantine across all batches. , Total size of all objects in global_quarantine across all batches. - bytes)
253  quarantine_head自加
254  如果quarantine_head恒等于QUARANTINE_BATCHESquarantine_head等于0
258  raw_spin_unlock_irqrestore( & quarantine_lock, flags)
260  qlist_free_all( & to_free, NULL)
261  注销过期读锁
调用者
名称描述
kasan_kmalloc_large