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:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bpf_percpu_lru_pop_free

Proto:static struct bpf_lru_node *bpf_percpu_lru_pop_free(struct bpf_lru *lru, u32 hash)

Type:struct bpf_lru_node

Parameter:

TypeParameterName
struct bpf_lru *lru
u32hash
403  struct bpf_lru_node * node = NULL
406  cpu = These macros fold the SMP functionality into a single CPU system()
408  l = per_cpu_ptr(percpu_lru, cpu)
410  raw_spin_lock_irqsave( & lock, flags)
412  1. Rotate the active list (if needed)* 2. Always rotate the inactive list
414  free_list = lists[BPF_LRU_LIST_T_FREE]
415  If list_empty - tests whether a list is empty*@head: the list to test. Then Calls __bpf_lru_list_shrink_inactive() to shrink some* ref-bit-cleared nodes and move them to the designated* free list
419  If Not list_empty - tests whether a list is empty*@head: the list to test. Then
420  node = list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.(free_list, structbpf_lru_node, list)
421  *(node + hash_offset) = hash
422  ref = 0
423  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).
426  raw_spin_unlock_irqrestore( & lock, flags)
428  Return node
Caller
NameDescribe
bpf_lru_pop_free