]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: introduce per-cpu cgroup local storage
authorRoman Gushchin <guro@fb.com>
Fri, 28 Sep 2018 14:45:43 +0000 (14:45 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 1 Oct 2018 14:18:32 +0000 (16:18 +0200)
commitf274d33ab75dd6bb7917b9ead1e072e771813c1e
treec5698184b5398cea8e288276844232d0101b64da
parent5e3acce783a1e1aaffdb870c423765b6208d1041
bpf: introduce per-cpu cgroup local storage

This commit introduced per-cpu cgroup local storage.

Per-cpu cgroup local storage is very similar to simple cgroup storage
(let's call it shared), except all the data is per-cpu.

The main goal of per-cpu variant is to implement super fast
counters (e.g. packet counters), which don't require neither
lookups, neither atomic operations.

>From userspace's point of view, accessing a per-cpu cgroup storage
is similar to other per-cpu map types (e.g. per-cpu hashmaps and
arrays).

Writing to a per-cpu cgroup storage is not atomic, but is performed
by copying longs, so some minimal atomicity is here, exactly
as with other per-cpu maps.

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf-cgroup.h
include/linux/bpf.h
include/linux/bpf_types.h
include/uapi/linux/bpf.h
kernel/bpf/helpers.c
kernel/bpf/local_storage.c
kernel/bpf/syscall.c
kernel/bpf/verifier.c