Skip to content

KFunc bpf_mem_cgroup_usage

v7.0

Read memory cGroup's usage.

Definition

Note

The root memory cGroup it special and is exempt from the memory accounting. The returned value is a sum of sub-cGroup's usages and it not reflecting the size of the root memory cGroup itself. If you need to get an approximation, you can use root level statistics: e.g. NR_FILE_PAGES + NR_ANON_MAPPED.

Parameters

memcg: memory cGroup

Returns

The current memory cGroup size in bytes.

Signature

long unsigned int bpf_mem_cgroup_usage(struct mem_cgroup *memcg)

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome