On 2/8/24 23:05, Alexei Starovoitov wrote:
The work on bpf_arena was inspired by Barret's work: https://github.com/google/ghost-userspace/blob/main/lib/queue.bpf.h that implements queues, lists and AVL trees completely as bpf programs using giant bpf array map and integer indices instead of pointers. bpf_arena is a sparse array that allows to use normal C pointers to build such data structures. Last few patches implement page_frag allocator, link list and hash table as bpf programs.
thanks for the shout-out. FWIW, i'm really looking forward to the BPF arena. it'll be a little work to switch from array maps to the arena, but in the long run, it'll vastly simplify our scheduler code.
additionally, the ability to map in pages on demand, instead of preallocating a potentially large array map, will both save memory as well as allow me to remove some artificial limitations on what our scheduler can handle. (e.g. don't limit ourselves to 64k threads).
thanks, barret