Re: bpf_timer memory utilization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 20, 2023 at 10:26 AM Chris Lai <chrlai@xxxxxxxxxxxxx> wrote:
>
> forgot to include the call back snippet
> static int myTimerCallback(void *map, struct ip_flow_tuple *key,
> struct ip_flow_entry *val) {
> bpf_map_delete_elem(map, key);
> return 0;
> }

Can you also check the returned value of bpf_map_delete_elem()? I
think there is a possibility that the bpf_timer_cancel_and_free() did
not get called for HASH and the timer gets leaked.

Looking at the path of htab_map_delete_elem(), it may fail in a few
places. For example, if we failed to acquire htab_lock, it returns
EBUSY; if there is race and we failed to find the element, it returns
ENOENT; check_and_free_fields() may also has a chance of failing, but
unfortunately we don't check the returned value.

Hao




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux