Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\bpf_lru_list.c Create Date:2022-07-28 13:12:27
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Rotate the inactive list. It starts from the next_inactive_rotation* 1. If the node has ref bit set, it will be moved to the head* of active list with the ref bit cleared.* 2. If the node does not have ref bit set, it will leave it

Proto:static void __bpf_lru_list_rotate_inactive(struct bpf_lru *lru, struct bpf_lru_list *l)

Type:void

Parameter:

TypeParameterName
struct bpf_lru *lru
struct bpf_lru_list *l
169  inactive = lists[BPF_LRU_LIST_T_INACTIVE]
170  next = inactive
172  i = 0
174  If list_empty - tests whether a list is empty*@head: the list to test. Then Return
177  last = next
178  If last == inactive Then last = next
181  cur = The next inacitve list rotation starts from here
182  When i < nr_scans cycle
183  If cur == inactive Then
184  cur = prev
185  Continue
188  node = list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(cur, structbpf_lru_node, list)
189  next = prev
190  If pf_lru_node helpers Then Move nodes between or within active and inactive list (like* active to inactive, inactive to active or tail of active back to* the head of active).
192  If cur == last Then Break
194  cur = next
195  i++
198  The next inacitve list rotation starts from here = next
Caller
NameDescribe
__bpf_lru_list_rotate1. Rotate the active list (if needed)* 2. Always rotate the inactive list