kernel/kernel/bpf/bpf_lru_list.h
.. .. @@ -64,11 +64,8 @@ 64 64 65 65 static inline void bpf_lru_node_set_ref(struct bpf_lru_node *node) 66 66 { 67 - /* ref is an approximation on access frequency. It does not68 - * have to be very accurate. Hence, no protection is used.69 - */70 - if (!node->ref)71 - node->ref = 1;67 + if (!READ_ONCE(node->ref))68 + WRITE_ONCE(node->ref, 1);72 69 } 73 70 74 71 int bpf_lru_init(struct bpf_lru *lru, bool percpu, u32 hash_offset,