Lines Matching defs:bpf_mem_cache
81 struct bpf_mem_cache {
104 struct bpf_mem_cache *tgt;
123 struct bpf_mem_cache cache[NUM_CACHES];
140 static void *__alloc(struct bpf_mem_cache *c, int node, gfp_t flags)
158 static struct mem_cgroup *get_memcg(const struct bpf_mem_cache *c)
169 static void inc_active(struct bpf_mem_cache *c, unsigned long *flags)
187 static void dec_active(struct bpf_mem_cache *c, unsigned long *flags)
194 static void add_obj_to_free_list(struct bpf_mem_cache *c, void *obj)
205 static void alloc_bulk(struct bpf_mem_cache *c, int cnt, int node, bool atomic)
277 struct bpf_mem_cache *c = container_of(head, struct bpf_mem_cache, rcu_ttrace);
294 static void enque_to_free(struct bpf_mem_cache *c, void *obj)
298 /* bpf_mem_cache is a per-cpu object. Freeing happens in irq_work.
304 static void do_call_rcu_ttrace(struct bpf_mem_cache *c)
333 static void free_bulk(struct bpf_mem_cache *c)
335 struct bpf_mem_cache *tgt = c->tgt;
363 struct bpf_mem_cache *c = container_of(head, struct bpf_mem_cache, rcu);
364 struct bpf_mem_cache *tgt = c->tgt;
382 static void check_free_by_rcu(struct bpf_mem_cache *c)
429 struct bpf_mem_cache *c = container_of(work, struct bpf_mem_cache, refill_work);
445 static void notrace irq_work_raise(struct bpf_mem_cache *c)
462 * bpf progs can and should share bpf_mem_cache when possible.
467 static void init_refill_work(struct bpf_mem_cache *c)
488 static void prefill_mem_cache(struct bpf_mem_cache *c, int cpu)
502 /* When size != 0 bpf_mem_cache for each cpu.
505 * When size == 0 allocate 11 bpf_mem_cache-s for each cpu, then rely on
512 struct bpf_mem_cache *c; struct bpf_mem_cache __percpu *pc;
596 struct bpf_mem_cache *c;
627 static void drain_mem_cache(struct bpf_mem_cache *c)
631 /* No progs are using this bpf_mem_cache, but htab_map_free() called
647 static void check_mem_cache(struct bpf_mem_cache *c)
661 struct bpf_mem_cache *c;
745 struct bpf_mem_cache *c;
782 static void notrace *unit_alloc(struct bpf_mem_cache *c)
803 *(struct bpf_mem_cache **)llnode = c;
825 static void notrace unit_free(struct bpf_mem_cache *c, void *ptr)
834 * Remember bpf_mem_cache that allocated this object.
837 c->tgt = *(struct bpf_mem_cache **)llnode;
865 static void notrace unit_free_rcu(struct bpf_mem_cache *c, void *ptr)
870 c->tgt = *(struct bpf_mem_cache **)llnode;
909 struct bpf_mem_cache *c;
925 struct bpf_mem_cache *c;
987 struct bpf_mem_cache *c;
1000 *(struct bpf_mem_cache **)ret = c;