Home
last modified time | relevance | path

Searched refs:objcg (Results 1 – 7 of 7) sorted by relevance

/kernel/linux/linux-5.10/mm/
Dslab.h282 struct obj_cgroup *objcg; in memcg_slab_pre_alloc_hook() local
290 objcg = get_obj_cgroup_from_current(); in memcg_slab_pre_alloc_hook()
291 if (!objcg) in memcg_slab_pre_alloc_hook()
294 if (obj_cgroup_charge(objcg, flags, objects * obj_full_size(s))) { in memcg_slab_pre_alloc_hook()
295 obj_cgroup_put(objcg); in memcg_slab_pre_alloc_hook()
299 *objcgp = objcg; in memcg_slab_pre_alloc_hook()
303 static inline void mod_objcg_state(struct obj_cgroup *objcg, in mod_objcg_state() argument
311 memcg = obj_cgroup_memcg(objcg); in mod_objcg_state()
318 struct obj_cgroup *objcg, in memcg_slab_post_alloc_hook() argument
326 if (!memcg_kmem_enabled() || !objcg) in memcg_slab_post_alloc_hook()
[all …]
Dpercpu.c1585 struct obj_cgroup *objcg; in pcpu_memcg_pre_alloc_hook() local
1590 objcg = get_obj_cgroup_from_current(); in pcpu_memcg_pre_alloc_hook()
1591 if (!objcg) in pcpu_memcg_pre_alloc_hook()
1594 if (obj_cgroup_charge(objcg, gfp, size * num_possible_cpus())) { in pcpu_memcg_pre_alloc_hook()
1595 obj_cgroup_put(objcg); in pcpu_memcg_pre_alloc_hook()
1599 *objcgp = objcg; in pcpu_memcg_pre_alloc_hook()
1603 static void pcpu_memcg_post_alloc_hook(struct obj_cgroup *objcg, in pcpu_memcg_post_alloc_hook() argument
1607 if (!objcg) in pcpu_memcg_post_alloc_hook()
1611 chunk->obj_cgroups[off >> PCPU_MIN_ALLOC_SHIFT] = objcg; in pcpu_memcg_post_alloc_hook()
1614 mod_memcg_state(obj_cgroup_memcg(objcg), MEMCG_PERCPU_B, in pcpu_memcg_post_alloc_hook()
[all …]
Dmemcontrol.c258 struct obj_cgroup *objcg = container_of(ref, struct obj_cgroup, refcnt); in obj_cgroup_release() local
284 nr_bytes = atomic_read(&objcg->nr_charged_bytes); in obj_cgroup_release()
289 memcg = obj_cgroup_memcg(objcg); in obj_cgroup_release()
292 list_del(&objcg->list); in obj_cgroup_release()
297 kfree_rcu(objcg, rcu); in obj_cgroup_release()
302 struct obj_cgroup *objcg; in obj_cgroup_alloc() local
305 objcg = kzalloc(sizeof(struct obj_cgroup), GFP_KERNEL); in obj_cgroup_alloc()
306 if (!objcg) in obj_cgroup_alloc()
309 ret = percpu_ref_init(&objcg->refcnt, obj_cgroup_release, 0, in obj_cgroup_alloc()
312 kfree(objcg); in obj_cgroup_alloc()
[all …]
Dslab.c3216 struct obj_cgroup *objcg = NULL; in slab_alloc_node() local
3219 cachep = slab_pre_alloc_hook(cachep, &objcg, 1, flags); in slab_alloc_node()
3255 slab_post_alloc_hook(cachep, objcg, flags, 1, &ptr); in slab_alloc_node()
3296 struct obj_cgroup *objcg = NULL; in slab_alloc() local
3299 cachep = slab_pre_alloc_hook(cachep, &objcg, 1, flags); in slab_alloc()
3313 slab_post_alloc_hook(cachep, objcg, flags, 1, &objp); in slab_alloc()
3506 struct obj_cgroup *objcg = NULL; in kmem_cache_alloc_bulk() local
3508 s = slab_pre_alloc_hook(s, &objcg, size, flags); in kmem_cache_alloc_bulk()
3531 slab_post_alloc_hook(s, objcg, flags, size, p); in kmem_cache_alloc_bulk()
3537 slab_post_alloc_hook(s, objcg, flags, i, p); in kmem_cache_alloc_bulk()
Dslub.c2822 struct obj_cgroup *objcg = NULL; in slab_alloc_node() local
2824 s = slab_pre_alloc_hook(s, &objcg, 1, gfpflags); in slab_alloc_node()
2899 slab_post_alloc_hook(s, objcg, gfpflags, 1, &object); in slab_alloc_node()
3289 struct obj_cgroup *objcg = NULL; in kmem_cache_alloc_bulk() local
3292 s = slab_pre_alloc_hook(s, &objcg, size, flags); in kmem_cache_alloc_bulk()
3346 slab_post_alloc_hook(s, objcg, flags, size, p); in kmem_cache_alloc_bulk()
3350 slab_post_alloc_hook(s, objcg, flags, i, p); in kmem_cache_alloc_bulk()
/kernel/linux/linux-5.10/include/linux/
Dmemcontrol.h315 struct obj_cgroup __rcu *objcg; member
519 static inline bool obj_cgroup_tryget(struct obj_cgroup *objcg) in obj_cgroup_tryget() argument
521 return percpu_ref_tryget(&objcg->refcnt); in obj_cgroup_tryget()
524 static inline void obj_cgroup_get(struct obj_cgroup *objcg) in obj_cgroup_get() argument
526 percpu_ref_get(&objcg->refcnt); in obj_cgroup_get()
529 static inline void obj_cgroup_put(struct obj_cgroup *objcg) in obj_cgroup_put() argument
531 percpu_ref_put(&objcg->refcnt); in obj_cgroup_put()
541 static inline struct mem_cgroup *obj_cgroup_memcg(struct obj_cgroup *objcg) in obj_cgroup_memcg() argument
543 return READ_ONCE(objcg->memcg); in obj_cgroup_memcg()
1569 int obj_cgroup_charge(struct obj_cgroup *objcg, gfp_t gfp, size_t size);
[all …]
/kernel/linux/linux-5.10/tools/cgroup/
Dmemcg_slabinfo.py187 obj_cgroups.add(memcg.objcg.value_())