Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754923AbaG3PqU (ORCPT ); Wed, 30 Jul 2014 11:46:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53485 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754715AbaG3PqS (ORCPT ); Wed, 30 Jul 2014 11:46:18 -0400 To: Alexei Starovoitov Cc: "David S. Miller" , Ingo Molnar , Linus Torvalds , Andy Lutomirski , Steven Rostedt , Daniel Borkmann , Chema Gonzalez , Eric Dumazet , Peter Zijlstra , Arnaldo Carvalho de Melo , Jiri Olsa , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Kees Cook , linux-api@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC v3 net-next 3/3] samples: bpf: eBPF dropmon example in C References: <1406000723-4872-1-git-send-email-ast@plumgrid.com> <1406000723-4872-4-git-send-email-ast@plumgrid.com> From: fche@redhat.com (Frank Ch. Eigler) Date: Wed, 30 Jul 2014 11:45:28 -0400 In-Reply-To: <1406000723-4872-4-git-send-email-ast@plumgrid.com> (Alexei Starovoitov's message of "Mon, 21 Jul 2014 20:45:23 -0700") Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ast wrote earlier: > [...] > dtrace/systemtap/ktap approach is to use one script file that should provide > all desired functionality. That architectural decision overcomplicated their > implementations. > > eBPF follows split model: everything that needs to process millions of events > per second needs to run in kernel and needs to be short and deterministic, > all other things like aggregation and nice graphs should run in user space. > [...] For the record, this is not entirely accurate as to dtrace. dtrace delegates aggregation and most reporting to userspace. Also, systemtap is "short and deterministic" even for aggregations & nice graphs, but since it limits its storage & cpu consumption, its arrays/reports cannot get super large. > [...] > +SEC("events/skb/kfree_skb") > +int bpf_prog2(struct bpf_context *ctx) > +{ > +[...] > + value = bpf_map_lookup_elem(&my_map, &loc); > + if (value) > + (*(long *) value) += 1; > + else > + bpf_map_update_elem(&my_map, &loc, &init_val); > + return 0; > +} What kind of locking/serialization is provided by the ebpf runtime over shared variables such as my_map? - FChE -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/