Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\percpu-stats.c Create Date:2022-07-28 16:36:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:percpu_stats_show

Proto:static int percpu_stats_show(struct seq_file *m, void *v)

Type:int

Parameter:

TypeParameterName
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  If Not buffer Then Return -ENOMEM
151  spin_lock_irq( & pcpu_lock)
154  If max_nr_alloc < Iterates over all chunks to find the max nr_alloc entries. Then
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  Go to 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  If 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. Then
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  When slot < pcpu_nr_slots cycle
208  seq_puts(m, "Chunk: <- First Chunk\n")
212  Else
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  Return 0