]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'bpf-per-cpu-maps'
authorDavid S. Miller <davem@davemloft.net>
Sat, 6 Feb 2016 08:34:46 +0000 (03:34 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Feb 2016 08:34:46 +0000 (03:34 -0500)
commit4c5296514e2f725d0f46421c82d2a117b8b3d532
treebacdf1b8025256fc591b1fd935a99f0b6af7466f
parent959b639cf60f9224b0bc20bb8a4388809807e6dd
parenta7ae239df65240b4bf888a9b496b2cee061770b3
Merge branch 'bpf-per-cpu-maps'

Alexei Starovoitov says:

====================
bpf: introduce per-cpu maps

We've started to use bpf to trace every packet and atomic add
instruction (event JITed) started to show up in perf profile.
The solution is to do per-cpu counters.
For PERCPU_(HASH|ARRAY) map the existing bpf_map_lookup() helper
returns per-cpu area which bpf programs can use to store and
increment the counters. The BPF_MAP_LOOKUP_ELEM syscall command
returns areas from all cpus and user process aggregates the counters.
The usage example is in patch 6. The api turned out to be very
easy to use from bpf program and from user space.
Long term we were discussing to add 'bounded loop' instruction,
so bpf programs can do aggregation within the program which may
help some use cases. Right now user space aggregation of
per-cpu counters fits the best.

This patch set is new approach for per-cpu hash and array maps.
I've reused the map tests written by Martin and Ming, but
implementation and api is new. Old discussion here:
http://thread.gmane.org/gmane.linux.kernel/2123800/focus=2126435
====================

Signed-off-by: David S. Miller <davem@davemloft.net>