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 A461FC282C8 for ; Mon, 28 Jan 2019 08:31:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6510620881 for ; Mon, 28 Jan 2019 08:31:37 +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="bzx7l43v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726689AbfA1Ibg (ORCPT ); Mon, 28 Jan 2019 03:31:36 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52228 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbfA1Ibg (ORCPT ); Mon, 28 Jan 2019 03:31:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=BULzY4/pdH3unS4ZIkU7/acGG7ba+udjRa5p9koTCnA=; b=bzx7l43vgvM+ORaToULVqEVW3 j/UIZu28GNAplyg2xLOxWPzkOLb0loJenVpt6tVArlkhx+NucIUIn0yVZCg//b8BOiBy1EwhZmAoo uK8Gh9mt1k92zFDkhtmwAt1HyICdGwEFBXbK2bTVu7W/gw66I72GiMhDQjyOb4CL3snXejUPKkSHj Y+UPdieN1koqbDKzzz3aMawfHicsTyjrIUhB30EzBsOAlv7+9vaWpmpRzzSqySfkfrBKW3TO67ABs EAQyHUk+6Q6cGzBYFWs84HGLQ+wB+2mkO4pfaK0S2u1TJQ6gtH6VA0VLND5oIeEY5hQz03m8rfGxS dnsN8vDmA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1go2KD-00035D-2w; Mon, 28 Jan 2019 08:31:25 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5047620101B8C; Mon, 28 Jan 2019 09:31:23 +0100 (CET) Date: Mon, 28 Jan 2019 09:31:23 +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: <20190128083123.GB28467@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190125234241.soomtkrgp2i7m7ul@ast-mbp.dhcp.thefacebook.com> 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 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.