On Wed, Dec 11, 2024 at 4:05 AM Vlastimil Babka <vbabka@xxxxxxx> wrote: > > On 12/10/24 03:39, Alexei Starovoitov wrote: > > From: Alexei Starovoitov <ast@xxxxxxxxxx> > > > > Unconditionally use __GFP_ACCOUNT in try_alloc_pages(). > > The caller is responsible to setup memcg correctly. > > All BPF memory accounting is memcg based. > > Hm I guess if there was later another user besides bpf that didn't want > memcg for some reason, a variant of the function (or a bool param, to avoid > passing full gfp param which would be thrown away besides __GFP_ACCOUNT) > could be easily created. Let's cross that bridge when we get there. tbh the code that doesn't play nice with memcg should be shamed. I think CONFIG_MEMCG should disappear and become a default.