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.
Showing the changes to include/uapi/linux (1 of 8 files). Show all
Unified · Split
| @@ -127,6 +127,7 @@ enum bpf_map_type { · 126 unmodified lines | ||
| 127 | 127 | BPF_MAP_TYPE_SOCKHASH, |
| 128 | 128 | BPF_MAP_TYPE_CGROUP_STORAGE, |
| 129 | 129 | BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, |
| 130 | + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, | |
| 130 | 131 | }; |
| 131 | 132 | |
| 132 | 133 | enum bpf_prog_type { |