Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6340596rwr; Tue, 9 May 2023 13:49:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HjrPyUyr4eSRSsqGfs0OQBmh1k5BT8Q3UUKWmvfj0QnrGvaWHp7OrKE3tM3cq3H/Kh7qt X-Received: by 2002:a17:902:dc81:b0:1ac:8cd6:9323 with SMTP id n1-20020a170902dc8100b001ac8cd69323mr4495562pld.22.1683665392337; Tue, 09 May 2023 13:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683665392; cv=none; d=google.com; s=arc-20160816; b=hWYHbTtYqyMGu4X6wSi3Fe2V9m+hxTash/bsZO8cKIXx23wF8VIwibORpcer71E3ak nK8il1ybCe+NbagOw4g1JGYrlFN6717UbkMBaGki0+wlpnQmmbdsMzNlvn3muI2Sn6G+ ZCRFMC6XsFlov1T1bYuiv8FKxvVvqKuzjPOm3raFVWYNEch9Z8+wkhA2Y6JjvDYU433x HB8Q2rAXFfDPiR0iOBPgN9a52h7Rp4MEWUPNrCI8wFCvB3NhP/4/IQWt/Mn4sT4mLXgk MJWP1NK78rgRhISQBjTFxce0y+JbKllIR1M/k56OpKblmmt6VQbuvrzsL22KIbJcuKih efZA== 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=bOLU3sapllcewNBR7FzZE4kRKHtulEGc3tuPC3AF1dw=; b=tcqJHj9NW/wR6P08n4RRRit1fEZZa/+E6i3EYTkpjOhzNz7M6yJ6WX+6WudRqM7pn5 22377nhuWMXDrTHLeqwLlj9C7N6VBh0WpSQOrIi/EzwOBOFJUBJ8CSPh4HQ3+PKIQMAU tJEbg0W/PB+nl8v82MS6h+xwaoDf9k8yg/y4qOufMxJBkCp5XU1+6m2ilxP8h0znUNOe gTLsKrGfHjlh+zWpkFOx8NRuwN5DO18YtE8KkSiTr6nxvO3oFfqX/W/xbmLXFgWkJPUA 2nCtwhps/iq+jLblhZY+Cq4ICEJWDLbZPKuKduaIqwMK+NYKiwBPgQFEP1jF9fMb8BZC SqXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=U8bcUVvo; 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 r7-20020a1709028bc700b001a4f005d59dsi2140420plo.389.2023.05.09.13.49.40; Tue, 09 May 2023 13:49:52 -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=U8bcUVvo; 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 S235100AbjEIUf7 (ORCPT + 99 others); Tue, 9 May 2023 16:35:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234572AbjEIUfy (ORCPT ); Tue, 9 May 2023 16:35:54 -0400 Received: from out-36.mta0.migadu.com (out-36.mta0.migadu.com [91.218.175.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BBC04C3E for ; Tue, 9 May 2023 13:35:51 -0700 (PDT) Date: Tue, 9 May 2023 16:35:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1683664550; 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=bOLU3sapllcewNBR7FzZE4kRKHtulEGc3tuPC3AF1dw=; b=U8bcUVvotaRPyRRACFPnRTRwvPS3y5ur307IdPdCCWvv/UwWw7OvkRF5cbgs6N3lhpYgze TrAoI+TVLgb0XR9foD0b810kH+b9S30Jf10Gm+3xJnpN8nlqTqJqHhGPlW/pNq0DDTZe9P mUpbKetA3FAX/6MKkBpPLhT0lZ6E1d8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Waiman Long Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Ingo Molnar , Will Deacon , 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: 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=unavailable 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 04:27:46PM -0400, Waiman Long wrote: > > On 5/9/23 16:18, Kent Overstreet wrote: > > 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. > > Maybe you can use lock_set_novalidate_class() instead. No, we want that to go away, this is the replacement.