Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6322146rwr; Tue, 9 May 2023 13:29:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75Hee+Z22JphdWgjesbm3BC/5Yti0lxRbHZwkyTXO5Ai3WmPUNZuSmpqUPXofI/ZPh51VJ X-Received: by 2002:a05:6a20:1445:b0:f3:b7:b10a with SMTP id a5-20020a056a20144500b000f300b7b10amr18896446pzi.15.1683664171992; Tue, 09 May 2023 13:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683664171; cv=none; d=google.com; s=arc-20160816; b=LoONYQi9ly2BWABF1DorvNBguAMqXO6Ag0h5eRPTFfosNIzL6u3Bt/rTxTSzbM0C09 cICbQdVSKJLLcrpBkt/rgpOpOdnJ8BnRldQTuYIxkJY4w8I2G5h7z48rEkfmrvXPlRd2 YT5tTXpsbbudmE2BP9ahmdtnD50tMvJSJJJl1C93iZ4xLZ2QjirGTrO75wUq4x1UW6Gd nJMn+cogdKDY/MZiEsBgoWCl+Xu2tAKU1tkInKaAB8lIERT+SK64V4WCzTFH6iNmvn/J dEC5ruTDss7hKa9+xKuez+YjBVmtgx38ypBhhhXrfpkRUsqp/uEbLYbuUi/9GYqauK/5 sh7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=3NB9UVIxBGJqWtZGB1ALQW3U92XErZENLAn8qk7xNIM=; b=xVRczPBpVx8octF4/RNv8cRutWGVNrTpbNdG8WpzPoei68hBh0opzBw1NKmZeANApD MdHIFZb8QGzFyJOkmndJOyCcn2OJezzOIOaiVWAuymEclIVFQUb8FaVCU5yU8EccqFH3 eFVCXawyt+FA7YsPu5hAkYaQRDbezFpJUoRCXZYVwXKSkG3YuLCqTQ4Hff417sbO+7xe o/EZyuOLOhFmrk9LkcW7X2M9I/bH8u3s/bbMpdPT1uWOEAeJFwYaxXDvke5DJighH/3a lVUD2dCPI96gJgji6M/W9E9/3Oc2wvjy8iFzKwQzb742Vl8c/b+sbP8UnHuMmdzSRwD8 O3wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=q5sPvgkB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k190-20020a636fc7000000b0052c3f0b850asi2370864pgc.221.2023.05.09.13.29.16; Tue, 09 May 2023 13:29:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=q5sPvgkB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230016AbjEIUTF (ORCPT + 99 others); Tue, 9 May 2023 16:19:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbjEIUTE (ORCPT ); Tue, 9 May 2023 16:19:04 -0400 Received: from out-63.mta0.migadu.com (out-63.mta0.migadu.com [91.218.175.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E25C33AAB for ; Tue, 9 May 2023 13:19:03 -0700 (PDT) Date: Tue, 9 May 2023 16:18:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1683663542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3NB9UVIxBGJqWtZGB1ALQW3U92XErZENLAn8qk7xNIM=; b=q5sPvgkBW++VRojipgY8KW+2lpXFtMiia21SScukswTn4rwBnEpdMkNzUrm6+sZ+5cH6ZX 6uNK6pOdWdmnNxPRrbBUmdrPhQROwqSSfWH0ihSZjx22vZ9ev/hhXiwllYyQiJjSVY5e5h WaPw1UVUFJn1+g0/r51dh8LdwRgHAtQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng Subject: Re: [PATCH 03/32] locking/lockdep: lockdep_set_no_check_recursion() Message-ID: References: <20230509165657.1735798-1-kent.overstreet@linux.dev> <20230509165657.1735798-4-kent.overstreet@linux.dev> <20230509193147.GC2148518@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230509193147.GC2148518@hirez.programming.kicks-ass.net> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 09, 2023 at 09:31:47PM +0200, Peter Zijlstra wrote: > On Tue, May 09, 2023 at 12:56:28PM -0400, Kent Overstreet wrote: > > This adds a method to tell lockdep not to check lock ordering within a > > lock class - but to still check lock ordering w.r.t. other lock types. > > > > This is for bcachefs, where for btree node locks we have our own > > deadlock avoidance strategy w.r.t. other btree node locks (cycle > > detection), but we still want lockdep to check lock ordering w.r.t. > > other lock types. > > > > ISTR you had a much nicer version of this where you gave a custom order > function -- what happend to that? Actually, I spoke too soon; this patch and the other series with the comparison function solve different problems. For bcachefs btree node locks, we don't have a defined lock ordering at all - we do full runtime cycle detection, so we don't want lockdep checking for self deadlock because we're handling that but we _do_ want lockdep checking lock ordering of btree node locks w.r.t. other locks in the system.