Re: [PATCH bpf-next 07/10] bpf: Switch to bpf mem allocator for LPM trie

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

 



On Sun, Nov 17, 2024 at 4:56 PM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote:
>
>
> +enum {
> +       LPM_TRIE_MA_IM = 0,
> +       LPM_TRIE_MA_LEAF,
> +       LPM_TRIE_MA_CNT,
> +};
> +
>  struct lpm_trie {
>         struct bpf_map                  map;
>         struct lpm_trie_node __rcu      *root;
> +       struct bpf_mem_alloc            ma[LPM_TRIE_MA_CNT];
> +       struct bpf_mem_alloc            *im_ma;
> +       struct bpf_mem_alloc            *leaf_ma;

We cannot use bpf_ma-s liberally like that.
Freelists are not huge, but we shouldn't be adding new bpf_ma
in every map and every use case.

bpf_mem_cache_is_mergeable() in the previous patch also
leaks implementation details.

Can you use bpf_global_ma for all nodes?

pw-bot: cr





[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