Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk, int *buffer)

Type:void

Parameter:

TypeParameterName
struct seq_file *m
struct pcpu_chunk *chunk
int *buffer
55  chunk_md = chunk_md
59  sum_frag = 0 , max_frag = 0
60  cur_min_alloc = 0 , cur_med_alloc = 0 , cur_max_alloc = 0
62  alloc_sizes = buffer
69  last_alloc = find_last_bit( allocation map , pcpu_chunk_map_bits - helper to convert nr_pages to size of bitmap*@chunk: chunk of interest* This conversion is from the number of physical pages that the chunk* serves to the number of bits in the bitmap. - additional area required to have the region end page aligned / PCPU_MIN_ALLOC_SIZE - 1)
72  last_alloc = If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then last_alloc + 1 Else 0
75  as_len = 0
76  start = the overlap with the previous region to have a page aligned base_addr / PCPU_MIN_ALLOC_SIZE
87  When start < last_alloc cycle
91  alloc_sizes[as_len] = 1
92  Else
95  alloc_sizes[as_len] = -1
98  alloc_sizes[as_len++] *= (end - start) * PCPU_MIN_ALLOC_SIZE
100  start = end
107  If as_len > 0 Then
108  sort(alloc_sizes, as_len, sizeof(int), cmpint, NULL)
111  When p < 0 && i < as_len cycle
112  sum_frag -= p
116  cur_min_alloc = alloc_sizes[i]
117  cur_med_alloc = alloc_sizes[(i + as_len - 1) / 2]
118  cur_max_alloc = alloc_sizes[as_len - 1]
121  P("nr_alloc", nr_alloc)
122  P("max_alloc_size", max_alloc_size)
123  P("empty_pop_pages", # of empty populated pages )
124  P("first_bit", lock position of first free )
125  P("free_bytes", free bytes in the chunk )
126  P("contig_bytes", contig hint for block * PCPU_MIN_ALLOC_SIZE)
127  P("sum_frag", sum_frag)
128  P("max_frag", max_frag)
129  P("cur_min_alloc", cur_min_alloc)
130  P("cur_med_alloc", cur_med_alloc)
131  P("cur_max_alloc", cur_max_alloc)
132  seq_putc(m, '\n')
Caller
NameDescribe
percpu_stats_show