函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:percpu_stats_show

函数原型:static int percpu_stats_show(struct seq_file *m, void *v)

返回类型:int

参数:

类型参数名称
struct seq_file *m
void *v
141  alloc_buffer :
142  spin_lock_irq( & pcpu_lock)
143  max_nr_alloc等于Iterates over all chunks to find the max nr_alloc entries.
144  spin_unlock_irq( & pcpu_lock)
147  buffer等于vmalloc - allocate virtually contiguous memory*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space.* For tight control over page level allocator and protection flags
148  如果非buffer则返回:负ENOMEM
151  spin_lock_irq( & pcpu_lock)
154  如果max_nr_alloc小于Iterates over all chunks to find the max nr_alloc entries.
155  spin_unlock_irq( & pcpu_lock)
156  vfree - release memory allocated by vmalloc()*@addr: memory base address* Free the virtually continuous memory area starting at @addr, as* obtained from vmalloc(), vmalloc_32() or __vmalloc()
157  转到:alloc_buffer
163  seq_printf(m, "Percpu Memory Statistics\nAllocation Info:\n----------------------------------------\n")
167  the buffer allocated earlier is too small (unit_size)
168  the buffer allocated earlier is too small (static_size)
169  the buffer allocated earlier is too small (Number of bytes to reserve for memory allocations made by device drivers* from their ->freeze() and ->freeze_noirq() callbacks so that they don't* cause image creation to fail (tunable via /sys/power/reserved_size).)
170  the buffer allocated earlier is too small (dyn_size)
171  the buffer allocated earlier is too small (atom_size)
172  the buffer allocated earlier is too small (alloc_size)
173  seq_putc(m, '\n')
180  seq_printf(m, "Global Stats:\n----------------------------------------\n")
183  PU(nr_alloc)
184  PU(nr_dealloc)
185  PU(nr_cur_alloc)
186  PU(nr_max_alloc)
187  PU(nr_chunks)
188  PU(nr_max_chunks)
189  PU(min_alloc_size)
190  PU(max_alloc_size)
191  P("empty_pop_pages", The number of empty populated pages, protected by pcpu_lock. The* reserved chunk doesn't contribute to the count.)
192  seq_putc(m, '\n')
196  seq_printf(m, "Per Chunk Stats:\n----------------------------------------\n")
200  如果Optional reserved chunk. This chunk reserves part of the first* chunk and serves it for reserved allocations. When the reserved* region doesn't exist, the following variable is NULL.
201  seq_puts(m, "Chunk: <- Reserved Chunk\n")
202  Prints out chunk state. Fragmentation is considered between* the beginning of the chunk to the last allocation.* All statistics are in bytes unless stated otherwise.
205 slot小于pcpu_nr_slots循环
208  seq_puts(m, "Chunk: <- First Chunk\n")
212  否则
213  seq_puts(m, "Chunk:\n")
220  spin_unlock_irq( & pcpu_lock)
222  vfree - release memory allocated by vmalloc()*@addr: memory base address* Free the virtually continuous memory area starting at @addr, as* obtained from vmalloc(), vmalloc_32() or __vmalloc()
224  返回:0