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 8BA33C282D7 for ; Wed, 30 Jan 2019 19:44:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55B552084C for ; Wed, 30 Jan 2019 19:44:26 +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="NY9OzM73" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387697AbfA3ToZ (ORCPT ); Wed, 30 Jan 2019 14:44:25 -0500 Received: from merlin.infradead.org ([205.233.59.134]:53512 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387587AbfA3ToZ (ORCPT ); Wed, 30 Jan 2019 14:44:25 -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=+BjLlp0hCEGBFCPiFnHZNmcODj1qPS4q2sTekkk0xlg=; b=NY9OzM73WkKSrpvL38z3Csnuc 9SIbTyGqgSPJ5I3zt/+Xvd5U9k2ZxW0dDvde537OM10eEqZq0flHpXY40y3Z19787xH05Ke3AaD3z uUxiwkr47CqWpraKSkXsZWxzcchzEArIpZNee5B8QZSNgxsoWixQgTHzsNPf99phuEeZwgGh2F2DK ajlXPf9awnUoFO87kFIzQ/Ka7nrWuZzqtyoURP8twXIDd+BrI/VLvCyZt0IH4GfdyG13UC6hVBt2B SzhkRkeOqFPB3sxxuojJT/jb3fXbFCUzrVQXu1/JB43KbL80Uifx26jtHNbHnkOPGWEh+3uqIa1bs VLsBEGaAA==; 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 1govmM-00071x-5p; Wed, 30 Jan 2019 19:44:10 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8759320423036; Wed, 30 Jan 2019 20:44:07 +0100 (CET) Date: Wed, 30 Jan 2019 20:44:07 +0100 From: Peter Zijlstra To: Alexei Starovoitov Cc: Alexei Starovoitov , davem@davemloft.net, daniel@iogearbox.net, edumazet@google.com, jannh@google.com, netdev@vger.kernel.org, kernel-team@fb.com, Waiman Long Subject: Re: [PATCH bpf-next 2/4] bpf: fix lockdep false positive in stackmap Message-ID: <20190130194407.GA3085@hirez.programming.kicks-ass.net> References: <20190130040458.2544340-1-ast@kernel.org> <20190130040458.2544340-3-ast@kernel.org> <20190130101530.GE2278@hirez.programming.kicks-ass.net> <20190130193040.3hmh6g7efk5z3g2j@ast-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190130193040.3hmh6g7efk5z3g2j@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 Wed, Jan 30, 2019 at 11:30:41AM -0800, Alexei Starovoitov wrote: > On Wed, Jan 30, 2019 at 11:15:30AM +0100, Peter Zijlstra wrote: > > On Tue, Jan 29, 2019 at 08:04:56PM -0800, Alexei Starovoitov wrote: > > > Lockdep warns about false positive: > > > > This is not a false positive, and you probably also need to use > > down_read_non_owner() to match this up_read_non_owner(). > > > > {up,down}_read() and {up,down}_read_non_owner() are not only different > > in the lockdep annotation; there is also optimistic spin stuff that > > relies on 'owner' tracking. > > Can you point out in the code the spin bit? Hurmph, looks like you're right. I got lost in that stuff again. I hate that rwsem code :/ Rewriting that all is on the todo list somewhere, but it's far down :/ > As far as I can see sem->owner is debug only feature. > All owner checks are done under CONFIG_DEBUG_RWSEMS. > > Also there is no down_read_trylock_non_owner() at the moment. > We can argue about it for -next, but I'd rather silence lockdep > with this patch today. I don't agree with calling is silencing; it fixes an mis-use of the API. But yes, keep the patch as is for now.