Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp957551rdh; Fri, 24 Nov 2023 01:58:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBGbI7DNZSm2EcX9HMgwcYq+aXI68JTiTh9hwm2vbsmMXpATDYJijodzhWkB4cPN4MqnFY X-Received: by 2002:a17:90b:4b82:b0:285:8d3f:6f8e with SMTP id lr2-20020a17090b4b8200b002858d3f6f8emr1161573pjb.15.1700819922675; Fri, 24 Nov 2023 01:58:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700819922; cv=none; d=google.com; s=arc-20160816; b=kwzBTnRqCMlBc/oLgkprI5X50hoZAwvC+RADez9PIfT4QYKFm9/RKMrt4SxUD8OqNc vXE644wPPIeNTWZ+eHLKvl1o+Yy4NNYApi6Tvw8hMUvqcDJhe+SGmo2HOUsuHoeeo6Su 23WKf1a9uzjqskOnmSmSDeeuN9Wxy74DgQTdLSUZUiWIozUjGIbZfKQDSSQoUNmlIoq8 UMQ3XTEG8WEEUq+unMfLQ9o6mzlE5vZ8RMd5UMfliIyqb3SGbEYbY+/VVVinEAofX8wc 59VPdPEAmDLWt3otxUdxPIJoSLY+1V/AYm0wlMhtfk4iZcJ7PvuBg43DLosrX+5kM88L SC4A== 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:date:dkim-signature; bh=lQ2sEyo0urN4jqBS+Brek2Bt3vMQro1GUUqvYK8rVKg=; fh=8omWIa0+D19lbrz7ssDJJPVAuyFcIqLous74S0AFJ6Y=; b=ANd9MJN1lv2705Y2jtjaWlUOI13UBcY3LeNDEBKkUcPLLKbEb1j4WM0UaGz3Lf/U0g GdxwHfGaIDUCJNeX7AkFFrgAqaaHlVUlcthfHdh1DncaoXBp8CNGFwavc/Fcp/pnwi/3 I2sHHUlaWE+obxi8cRU0uPpxq7K1AFrfv1Bbhm8KgX26sabqhJB9t381QMx5dPida6dP bVyTpfQekHXoVf4lt+ZDv989VAJwR146cd4SJvvtetIeF20jsLvzfbOMa9OJCgs6hXZH 1N4+wYfHsh9oUF3P8wqgA160sAtiErKezwyiqwkLjf4hQQhX0JVRHhpVOrz7YCKmY3KI MDuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BjHyofms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id i4-20020a17090ad34400b002748c1bbd79si3883924pjx.6.2023.11.24.01.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 01:58:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BjHyofms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 59BF7835B4F1; Fri, 24 Nov 2023 01:58:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234620AbjKXJ6M (ORCPT + 99 others); Fri, 24 Nov 2023 04:58:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbjKXJ6J (ORCPT ); Fri, 24 Nov 2023 04:58:09 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 038601A5; Fri, 24 Nov 2023 01:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=lQ2sEyo0urN4jqBS+Brek2Bt3vMQro1GUUqvYK8rVKg=; b=BjHyofms7LwAPkjS/tCo81dqdf liv0pQJOMBKG92oyTeTaSxR7JKhtPG90Qk+jDVwl0eXgFwZXTK8iTJfaV3tOAA+2158stf9cmoccC cWA1T3V/bsTghJosQRtjs9NXmAC5n4+ZR7+g45jyi4yhCbskaLjYxPeQ1ZRkNQOyFL1DyP0x5iN6c KdUjrm3+OtMB75K1RKaII80q8Gj6LymQcaCudX1TbnA7OoJ11MLCerN1VuiotnlLtjyhMkzpfYkFi 5aICT41xJ1YubZnl1s0uHdYIXjDOqCz27eUg8cBCouyWDgjlrtQQNkvlBrK5qdWHnVUy5UaYCaYrq IzN65htw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r6Swm-008Rgh-Se; Fri, 24 Nov 2023 09:58:04 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 87E75300338; Fri, 24 Nov 2023 10:58:04 +0100 (CET) Date: Fri, 24 Nov 2023 10:58:04 +0100 From: Peter Zijlstra To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-bcachefs@vger.kernel.org, boqun.feng@gmail.com, longman@redhat.com, will@kernel.org, mingo@redhat.com Subject: Re: [PATCH 2/6] locking/lockdep: lockdep_set_no_check_recursion() Message-ID: <20231124095804.GO3818@noisy.programming.kicks-ass.net> References: <20231122235113.180132-1-kent.overstreet@linux.dev> <20231122235113.180132-3-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231122235113.180132-3-kent.overstreet@linux.dev> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 24 Nov 2023 01:58:40 -0800 (PST) On Wed, Nov 22, 2023 at 06:51:09PM -0500, 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. So earlier you added custom sort order. Additionally there is the wound-wait mutexes that also have semantics similar to what you describe. Explain why you can't use either your own added feature or the existing infrastructure to solve this?