Martin KaFai Lau bb9b9f8802 bpf: Only set node->ref = 1 if it has not been set
This patch writes 'node->ref = 1' only if node->ref is 0.
The number of lookups/s for a ~1M entries LRU map increased by
~30% (260097 to 343313).

Other writes on 'node->ref = 0' is not changed.  In those cases, the
same cache line has to be changed anyway.

First column: Size of the LRU hash
Second column: Number of lookups/s

Before:
> echo "$((2**20+1)): $(./map_perf_test 1024 1 $((2**20+1)) 10000000 | awk '{print $3}')"
1048577: 260097

After:
> echo "$((2**20+1)): $(./map_perf_test 1024 1 $((2**20+1)) 10000000 | awk '{print $3}')"
1048577: 343313

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-01 09:57:39 -07:00
..
2017-05-12 15:57:15 -07:00
2017-05-23 10:01:37 +02:00
2017-08-16 16:48:34 -07:00
2017-06-12 18:07:43 -04:00
2017-01-12 07:01:56 -07:00
2017-05-18 10:30:19 -06:00
2015-11-23 09:44:58 +01:00
2017-05-08 17:15:12 -07:00
2017-08-18 15:32:01 -07:00
2017-07-12 17:22:01 -07:00
2017-08-21 12:47:31 -07:00
2016-03-01 20:36:56 +01:00
2016-12-22 22:58:37 -05:00
2017-07-12 09:15:00 -07:00