On Fri, Sep 05, 2025 at 12:48:11PM -0700, Shakeel Butt wrote: > On Fri, Sep 05, 2025 at 10:31:07AM -0700, Shakeel Butt wrote: > > On Fri, Sep 05, 2025 at 08:18:25AM -0700, Alexei Starovoitov wrote: > > > On Thu, Sep 4, 2025 at 11:20 PM Peilin Ye <yepeilin@xxxxxxxxxx> wrote: > > > > As pointed out by Kumar, we can use bpf_mem_alloc() and friends for > > > > bpf_hrtimer and bpf_work, to skip memcg accounting. > > > > > > This is a short term workaround that we shouldn't take. > > > Long term bpf_mem_alloc() will use kmalloc_nolock() and > > > memcg accounting that was already made to work from any context > > > except that the path of memcg_memory_event() wasn't converted. > > > > > > Shakeel, > > > > > > Any suggestions how memcg_memory_event()->cgroup_file_notify() > > > can be fixed? > > > Can we just trylock and skip the event? > > > > Will !gfpflags_allow_spinning(gfp_mask) be able to detect such call > > chains? If yes, then we can change memcg_memory_event() to skip calls to > > cgroup_file_notify() if spinning is not allowed. > > Along with using __GFP_HIGH instead of GFP_ATOMIC in __bpf_async_init() Ah, I see, thanks for the suggestion - I'll send a separate patch to do this. Peilin Ye