]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Memcg-based memory accounting for bpf maps
authorRoman Gushchin <guro@fb.com>
Tue, 1 Dec 2020 21:58:33 +0000 (13:58 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Dec 2020 02:32:45 +0000 (18:32 -0800)
commit8d4a954e824476f6dbf521c4d1bf45522e440816
tree8da721c013c8ad952eeacae9ac6bf67e531cfac6
parentaa095da1c65094aeb68be32523b4c106f6f5b411
bpf: Memcg-based memory accounting for bpf maps

This patch enables memcg-based memory accounting for memory allocated
by __bpf_map_area_alloc(), which is used by many types of bpf maps for
large initial memory allocations.

Please note, that __bpf_map_area_alloc() should not be used outside of
map creation paths without setting the active memory cgroup to the
map's memory cgroup.

Following patches in the series will refine the accounting for
some of the map types.

Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201201215900.3569844-8-guro@fb.com
kernel/bpf/syscall.c