diff options
author | Martin KaFai Lau <kafai@fb.com> | 2017-04-14 19:30:30 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-17 19:55:52 +0200 |
commit | 3a5795b83d578cc542a92c94399946258cf1a2af (patch) | |
tree | f5d017cbdf7cd49aaa75c17c97abc4a3346f1237 /crypto | |
parent | bpf: lru: Lower the PERCPU_NR_SCANS from 16 to 4 (diff) | |
download | linux-3a5795b83d578cc542a92c94399946258cf1a2af.tar.xz linux-3a5795b83d578cc542a92c94399946258cf1a2af.zip |
bpf: lru: Add map-in-map LRU example
This patch adds a map-in-map LRU example.
If we know only a subset of cores will use the
LRU, we can allocate a common LRU list per targeting core
and store it into an array-of-hashs.
It allows using the common LRU map with map-update performance
comparable to the BPF_F_NO_COMMON_LRU map but without wasting memory
on the unused cores that we know they will never access the LRU map.
BPF_F_NO_COMMON_LRU:
> map_perf_test 32 8 10000000 10000000 | awk '{sum += $3}END{print sum}'
9234314 (9.23M/s)
map-in-map LRU:
> map_perf_test 512 8 1260000 80000000 | awk '{sum += $3}END{print sum}'
9962743 (9.96M/s)
Notes that the max_entries for the map-in-map LRU test is 1260000 which
is the max_entries for each inner LRU map. 8 processes have been
started, so 8 * 1260000 = 10080000 (~10M) which is close to what is
used in the BPF_F_NO_COMMON_LRU test.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions