From: David Miller <davem@davemloft.net>
To: ast@fb.com
Cc: kafai@fb.com, tom.leiming@gmail.com, daniel@iogearbox.net,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next 0/6] bpf: introduce per-cpu maps
Date: Sat, 06 Feb 2016 03:35:10 -0500 (EST) [thread overview]
Message-ID: <20160206.033510.1628943759911841700.davem@davemloft.net> (raw)
In-Reply-To: <1454395198-1796236-1-git-send-email-ast@fb.com>
From: Alexei Starovoitov <ast@fb.com>
Date: Mon, 1 Feb 2016 22:39:52 -0800
> 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
Series applied, thanks Alexei.
prev parent reply other threads:[~2016-02-06 8:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 6:39 [PATCH net-next 0/6] bpf: introduce per-cpu maps Alexei Starovoitov
2016-02-02 6:39 ` [PATCH net-next 1/6] bpf: introduce BPF_MAP_TYPE_PERCPU_HASH map Alexei Starovoitov
2016-02-02 6:39 ` [PATCH net-next 2/6] bpf: introduce BPF_MAP_TYPE_PERCPU_ARRAY map Alexei Starovoitov
2016-02-02 6:39 ` [PATCH net-next 3/6] bpf: add lookup/update support for per-cpu hash and array maps Alexei Starovoitov
2016-02-02 6:39 ` [PATCH net-next 4/6] samples/bpf: unit test for BPF_MAP_TYPE_PERCPU_HASH Alexei Starovoitov
2016-02-02 6:39 ` [PATCH net-next 5/6] samples/bpf: unit test for BPF_MAP_TYPE_PERCPU_ARRAY Alexei Starovoitov
2016-02-02 6:39 ` [PATCH net-next 6/6] samples/bpf: update tracex[23] examples to use per-cpu maps Alexei Starovoitov
2016-02-06 8:35 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160206.033510.1628943759911841700.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=netdev@vger.kernel.org \
--cc=tom.leiming@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).