diff options
author | Martin KaFai Lau <kafai@fb.com> | 2020-06-17 19:42:26 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-06-18 23:41:09 +0200 |
commit | 7c7982cbadbb63eb76401ddc4ef090cf7ae274b4 (patch) | |
tree | ec72373aaeaa183802cb6cc4bd46feb2098541aa /kernel/bpf | |
parent | libbpf: Bump version to 0.1.0 (diff) | |
download | linux-7c7982cbadbb63eb76401ddc4ef090cf7ae274b4.tar.xz linux-7c7982cbadbb63eb76401ddc4ef090cf7ae274b4.zip |
bpf: sk_storage: Prefer to get a free cache_idx
The cache_idx is currently picked by RR. There is chance that
the same cache_idx will be picked by multiple sk_storage_maps while
other cache_idx is still unused. e.g. It could happen when the
sk_storage_map is recreated during the restart of the user
space process.
This patch tracks the usage count for each cache_idx. There is
16 of them now (defined in BPF_SK_STORAGE_CACHE_SIZE).
It will try to pick the free cache_idx. If none was found,
it would pick one with the minimal usage count.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200617174226.2301909-1-kafai@fb.com
Diffstat (limited to 'kernel/bpf')
0 files changed, 0 insertions, 0 deletions