From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2663DC282C8 for ; Mon, 28 Jan 2019 08:35:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD4CD20881 for ; Mon, 28 Jan 2019 08:35:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="tuJAEtb2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726919AbfA1If0 (ORCPT ); Mon, 28 Jan 2019 03:35:26 -0500 Received: from merlin.infradead.org ([205.233.59.134]:32970 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726772AbfA1If0 (ORCPT ); Mon, 28 Jan 2019 03:35:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GqM27W06Z0LAPnh1hv7YgeiOUhFFfkxjCAij2yQ4lW8=; b=tuJAEtb2l5SWOOTnuJQTx9RUy +fsGlNIo4/IC0e71mLbhlw58ZKmysomQBtimGPM6Cz2iOFfT3rGiF7LShDhRqoVFaEfORISUO3CLF e0wnuXmCjExbcCbRp60WUq6SMdi7S418dzxsL7F9Xtm9Hx5CaXCE/xbXHlHLbcOh5JWPGG0fs6ZLe aabI2YXCGkfga6SAvaNU8+dgaTyuq6BiGctQjfn0rr6/XXcKmzoe5rm9YHTv5r2cieDVMx2Ye9jut qG0VQN5RtkTxAE8UyTyk9r6vXMUI3oZ+p+eVx4pREIwbzbWuGz7TKL6CDKxakm8mtFWpRdAqD8Bhq KkTWG6qIA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1go2Np-0005f5-EZ; Mon, 28 Jan 2019 08:35:09 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 35F0120101B8C; Mon, 28 Jan 2019 09:35:08 +0100 (CET) Date: Mon, 28 Jan 2019 09:35:08 +0100 From: Peter Zijlstra To: Alexei Starovoitov Cc: Alexei Starovoitov , davem@davemloft.net, daniel@iogearbox.net, jakub.kicinski@netronome.com, netdev@vger.kernel.org, kernel-team@fb.com, mingo@redhat.com, will.deacon@arm.com, Paul McKenney , jannh@google.com Subject: Re: [PATCH v4 bpf-next 1/9] bpf: introduce bpf_spin_lock Message-ID: <20190128083508.GA28878@hirez.programming.kicks-ass.net> References: <20190124041403.2100609-1-ast@kernel.org> <20190124041403.2100609-2-ast@kernel.org> <20190124180109.GA27771@hirez.programming.kicks-ass.net> <20190124235857.xyb5xx2ufr6x5mbt@ast-mbp.dhcp.thefacebook.com> <20190125091057.GK17749@hirez.programming.kicks-ass.net> <20190125234241.soomtkrgp2i7m7ul@ast-mbp.dhcp.thefacebook.com> <20190128083123.GB28467@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190128083123.GB28467@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Jan 28, 2019 at 09:31:23AM +0100, Peter Zijlstra wrote: > On Fri, Jan 25, 2019 at 03:42:43PM -0800, Alexei Starovoitov wrote: > > On Fri, Jan 25, 2019 at 10:10:57AM +0100, Peter Zijlstra wrote: > > > On Thu, Jan 24, 2019 at 03:58:59PM -0800, Alexei Starovoitov wrote: > > > > > nmi checks for bpf_prog_active==0. See bpf_overflow_handler. > > > > yuck yuck yuck.. That's horrific :-( That means the whole BPF crud is > > > unreliable and events can go randomly missing. > > > > bpf_prog_active is the mechanism to workaround non-reentrant pieces of the kernel. > > 'the kernel' or 'bpf' ? > > perf has a recursion counter per context (task,softirq,hardirq,nmi) and > that ensures that perf doesn't recurse in on itself while allowing the > nesting of these contexts. > > But if BPF itself is not able to deal with such nesting that won't work > of course. Ooh, later you say: > Also we allow tracing progs to nest with networking progs. Which seems to suggest BPF itself can suppord (limited) nesting. See: kernel/events/internal.h:get_recursion_context()