]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: introduce BPF_MAP_TYPE_PERCPU_ARRAY map
authorAlexei Starovoitov <ast@fb.com>
Tue, 2 Feb 2016 06:39:54 +0000 (22:39 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Feb 2016 08:34:36 +0000 (03:34 -0500)
commita80d199866f9112c22aa21c6e3e066083bdd97ce
tree2a8296c94fc90056e7a8d2b2dd3b31d4d3d73d5b
parent2a795eb28cbde8b078ce36825b104d3f95422c7c
bpf: introduce BPF_MAP_TYPE_PERCPU_ARRAY map

Primary use case is a histogram array of latency
where bpf program computes the latency of block requests or other
events and stores histogram of latency into array of 64 elements.
All cpus are constantly running, so normal increment is not accurate,
bpf_xadd causes cache ping-pong and this per-cpu approach allows
fastest collision-free counters.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/arraymap.c