On Mon, 2024-02-12 at 16:44 -0800, Alexei Starovoitov wrote: > > I hit a strange bug when playing with patch. Consider a simple example [0]. > > When the following BPF global variable: > > > > int __arena * __arena bar; > > > > - is commented -- the test passes; > > - is uncommented -- in the test fails because global variable 'shared' is NULL. > > Right. That's expected, because __uint(max_entries, 1); > The test creates an area on 1 page and it's consumed > by int __arena * __arena bar; variable. > Of course, one variable doesn't take the whole page. > There could have been many arena global vars. > But that page is not available anymore to bpf_arena_alloc_pages, > so it returns NULL. My bad, thank you for explaining.