mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
Revert "bpf: add percpu stats for bpf_map elements insertions/deletions"
This reverts commita6fb03a9c9which is commit2595473046upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: Idf75ac8d96a98127aac4ccf1d0c78dd4668f5664 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -253,7 +253,6 @@ struct bpf_map {
|
||||
} owner;
|
||||
bool bypass_spec_v1;
|
||||
bool frozen; /* write-once; write-protected by freeze_mutex */
|
||||
s64 __percpu *elem_count;
|
||||
};
|
||||
|
||||
static inline bool map_value_has_spin_lock(const struct bpf_map *map)
|
||||
@@ -1804,35 +1803,6 @@ bpf_map_alloc_percpu(const struct bpf_map *map, size_t size, size_t align,
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
bpf_map_init_elem_count(struct bpf_map *map)
|
||||
{
|
||||
size_t size = sizeof(*map->elem_count), align = size;
|
||||
gfp_t flags = GFP_USER | __GFP_NOWARN;
|
||||
|
||||
map->elem_count = bpf_map_alloc_percpu(map, size, align, flags);
|
||||
if (!map->elem_count)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
bpf_map_free_elem_count(struct bpf_map *map)
|
||||
{
|
||||
free_percpu(map->elem_count);
|
||||
}
|
||||
|
||||
static inline void bpf_map_inc_elem_count(struct bpf_map *map)
|
||||
{
|
||||
this_cpu_inc(*map->elem_count);
|
||||
}
|
||||
|
||||
static inline void bpf_map_dec_elem_count(struct bpf_map *map)
|
||||
{
|
||||
this_cpu_dec(*map->elem_count);
|
||||
}
|
||||
|
||||
extern int sysctl_unprivileged_bpf_disabled;
|
||||
|
||||
static inline bool bpf_allow_ptr_leaks(void)
|
||||
|
||||
Reference in New Issue
Block a user