函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk, int *buffer)

返回类型:void

参数:

类型参数名称
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等于查找最后的CPU标志位
72  last_alloc等于如果st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting fromlast_alloc加1否则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 start小于last_alloc循环
91  alloc_sizes[as_len]等于1
92  否则
95  alloc_sizes[as_len]等于负1
98  alloc_sizes[as_len++]乘等于endstart的差乘PCPU_MIN_ALLOC_SIZE
100  start等于end
107  如果as_len大于0则
108  sort(alloc_sizes, as_len, sizeof(int), cmpint, NULL)
111 p小于0且i小于as_len循环
112  sum_frag减等于p
113  max_frag等于两数取大(max_frag, - 1 * ( * 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')
调用者
名称描述
percpu_stats_show