Message ID | 20230621023238.87079-9-alexei.starovoitov@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | bpf: Introduce bpf_mem_cache_free_rcu(). | expand |
diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c index 8b7645bffd1a..10d027674743 100644 --- a/kernel/bpf/memalloc.c +++ b/kernel/bpf/memalloc.c @@ -202,6 +202,15 @@ static void alloc_bulk(struct bpf_mem_cache *c, int cnt, int node) if (i >= cnt) return; + for (; i < cnt; i++) { + obj = llist_del_first(&c->waiting_for_gp_ttrace); + if (!obj) + break; + add_obj_to_free_list(c, obj); + } + if (i >= cnt) + return; + memcg = get_memcg(c); old_memcg = set_active_memcg(memcg); for (; i < cnt; i++) {