History

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.

Roman Gushchin committed 8 years ago

Commit b741f161 parent f294b378 files · +179 −28Browse files

Showing the changes to include/uapi/linux (1 of 8 files). Show all

Unified · Split

include/uapi/linux/bpf.h+1−0
@@ -127,6 +127,7 @@ enum bpf_map_type { · 126 unmodified lines
127 BPF_MAP_TYPE_SOCKHASH,127 BPF_MAP_TYPE_SOCKHASH,
128 BPF_MAP_TYPE_CGROUP_STORAGE,128 BPF_MAP_TYPE_CGROUP_STORAGE,
129 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,129 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
130 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
130};131};
131 132
132enum bpf_prog_type {133enum bpf_prog_type {