Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1703729ybs; Tue, 26 May 2020 01:19:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy248wTGJZ/Tqq8wGjKbjeKIxDcY0IO3M5RRZVI1B138TK2YRnrYOX6579rEyGTXo+Gin/q X-Received: by 2002:a17:906:5e46:: with SMTP id b6mr113168eju.177.1590481154714; Tue, 26 May 2020 01:19:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590481154; cv=none; d=google.com; s=arc-20160816; b=z3nd2Z9r6i83GmZhCjb+z/eMgh82S5XOylfaxg1F7+fswTp+HYDAtCNgIlTOH9BHH9 c7fL2L1EyuadRiN3AIl6FATeN6zbKdPGP6O4SLpfBu7ncOIP8+a8RgqaDn3wbJv4cpWD RpeT0INhxjd4vdwc/RknT+SdX2Y5QwvXfMXjf9AimTKmhWrgnpJUQUU0MzHTvLVOAnap Y7IAiJ84GQGR9hW80/frCGEvqgiC3cbLPfr0PKaHGXsxB4eGUOXBGLm8Rkf4LhjBsaBN YoqPQirAgg65YtH5ghqKlPvf60kXwo0q+pv6hQsOtVrDaqqiMp+xJHFB9Ka1vdjbo4F5 1zHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=e2MwWe7Ixqq38W0YV5HpIWiJs7gWWp0umQ/6FgHLKss=; b=GUFpdXPvwACByQHJGZb0QDTwfEfZ0Tf6T/qjofP+u+3JZklxSFZpKuwLsO58ib49oi hdMEFPzSUBGdUFL0qst4ZxgzRaZjeLHt/1EjCx54pNDkKRkNckql+RF5hD1Xdf3LDZRE SYl2BS6jsYkXfNurvSoy6SJjSC4yYoN6h5CJvCZqXSiJ0zWjRw3QZ8oF0LkIXwkSX+vd jKrT57xj4EFvHUuitpVQMrB2WpICocI38AefdI8shd638wARArpT5LAgDJrjUnvWxoHh ivLGRlS1sf79/gEo5zQFXUbVTkKHRQndLLg5dn/jvgJ6oe0nRbg8TopTrbZSA0HKN9Mi 3Stw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=uZAIMZI4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb5si10565290ejb.426.2020.05.26.01.18.42; Tue, 26 May 2020 01:19:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=uZAIMZI4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728888AbgEZIQo (ORCPT + 99 others); Tue, 26 May 2020 04:16:44 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52432 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbgEZIQn (ORCPT ); Tue, 26 May 2020 04:16:43 -0400 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; bh=e2MwWe7Ixqq38W0YV5HpIWiJs7gWWp0umQ/6FgHLKss=; b=uZAIMZI4tKYflTVu4AkMQ8ugSL i0wE2fZF3kQP9C4bNOFFwKZVeKPshT0KB0qNTE7PIMLM9MjrNBldjeMNNLHK82hitFWTHPDhrfSJG /B34llj/JtKVzQeCf5Xzc8ksZTsotqI3aMzvBLpD+mcdOvrArgUVK57tAtSEZwk1s88MvBGf1+WJt lIBrCnga/ICVWtmz0pxDGV4qF4OGzGpPV+6uQXxjWyK0jUT09fvFkswgOqKAE/9raQxwK7TCTxugS q5KFMzHgflz6GWMssFtGnw0Xir81UC2tA1jGd9qCqzAbXyQylwMDCVpsDfz/k2/p+R07Nb799EmT2 jXqEDU3A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdUin-0003ao-2Y; Tue, 26 May 2020 08:14:01 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F0BDF30280E; Tue, 26 May 2020 10:13:50 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A514020BE0DF0; Tue, 26 May 2020 10:13:50 +0200 (CEST) Date: Tue, 26 May 2020 10:13:50 +0200 From: Peter Zijlstra To: "Ahmed S. Darwish" Cc: "Sebastian A. Siewior" , Ingo Molnar , Will Deacon , Thomas Gleixner , "Paul E. McKenney" , Steven Rostedt , LKML Subject: Re: [PATCH v1 07/25] lockdep: Add preemption disabled assertion API Message-ID: <20200526081350.GI317569@hirez.programming.kicks-ass.net> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200519214547.352050-8-a.darwish@linutronix.de> <20200522175503.GQ325280@hirez.programming.kicks-ass.net> <20200523145942.vjk3z6pbj6yicqa4@linutronix.de> <20200523224132.GD2483@worktop.programming.kicks-ass.net> <20200525102241.GF325303@hirez.programming.kicks-ass.net> <20200526005231.GA377571@debian-buster-darwi.lab.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200526005231.GA377571@debian-buster-darwi.lab.linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 02:52:31AM +0200, Ahmed S. Darwish wrote: > Peter Zijlstra wrote: > > +#define lockdep_assert_irqs_enabled() \ > > +do { \ > > + WARN_ON_ONCE(debug_locks && !this_cpu_read(hardirqs_enabled)); \ > > +} while (0) > > > > Given that lockdep_off() is defined at lockdep.c as: > > void lockdep_off(void) > { > current->lockdep_recursion += LOCKDEP_OFF; > } > > This would imply that all of the macros: > > - lockdep_assert_irqs_enabled() > - lockdep_assert_irqs_disabled() > - lockdep_assert_in_irq() > - lockdep_assert_preemption_disabled() > - lockdep_assert_preemption_enabled() > > will do the lockdep checks *even if* lockdep_off() was called. > > This doesn't sound right. Even if all of the above macros call sites > didn't care about lockdep_off()/on(), it is semantically incoherent. lockdep_off() is an abomination and really should not exist. That dm-cache-target.c thing, for example, is atrocious shite that will explode on -rt. Whoever wrote that needs a 'medal'. People using it deserve all the pain they get. Also; IRQ state _should_ be tracked irrespective of tracking lock dependencies -- I see that that currently isn't entirely the case, lemme go fix that.