Lines Matching +full:cpu +full:- +full:map
1 .. SPDX-License-Identifier: GPL-2.0-only
8 The ``BPF_MAP_TYPE_CGROUP_STORAGE`` map type represents a local fix-sized
13 The map provide a local storage at the cgroup that the BPF program is attached
19 ``BPF_MAP_TYPE_CGROUP_STORAGE`` map type. Some of its behaviors was changed in
25 The map uses key of type of either ``__u64 cgroup_inode_id`` or
38 map will share the same storage. Otherwise, if the type is
44 void *bpf_get_local_storage(void *map, u64 flags)
75 Userspace accessing map declared above::
80 __u32 map_lookup(struct bpf_map *map, __u64 cgrp, enum bpf_attach_type type)
87 bpf_map_lookup_elem(bpf_map__fd(map), &key, &value);
115 __u32 map_lookup(struct bpf_map *map, __u64 cgrp, enum bpf_attach_type type)
118 bpf_map_lookup_elem(bpf_map__fd(map), &cgrp, &value);
126 ``BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE`` is a variant of this map type. This
127 per-CPU variant will have different memory regions for each CPU for each
128 storage. The non-per-CPU will have the same memory region for each storage.
130 Prior to Linux 5.9, the lifetime of a storage is precisely per-attachment, and
131 for a single ``CGROUP_STORAGE`` map, there can be at most one program loaded
132 that uses the map. A program may be attached to multiple cgroups or have
136 There is a one-to-one association between the map of each type (per-CPU and
137 non-per-CPU) and the BPF program during load verification time. As a result,
138 each map can only be used by one BPF program and each BPF program can only use
139 one storage map of each type. Because of map can only be used by one BPF
144 attached to a cgroup, the kernel would create a new storage only if the map
146 the old storage is reused for the new attachment. If the map is attach type
148 only when either the map or the cgroup attached to is being freed. Detaching
149 will not directly free the storage, but it may cause the reference to the map
150 to reach zero and indirectly freeing all storage in the map.
152 The map is not associated with any BPF program, thus making sharing possible.
153 However, the BPF program can still only associate with one map of each type
154 (per-CPU and non-per-CPU). A BPF program cannot use more than one
159 attach type pair in ``struct bpf_cgroup_storage_key`` as the key to the BPF map
168 Userspace cannot create a new entry in the map or delete an existing entry.