Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6441273rwr; Tue, 9 May 2023 15:34:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gVVe5Ke61hthy64PU+TckxSB0X5QpDsyBzO2RhchllIlqGZuA7s8RDGinRGs8ZJy8Mr7j X-Received: by 2002:a17:902:6ac3:b0:1ac:93ba:a5ec with SMTP id i3-20020a1709026ac300b001ac93baa5ecmr3887043plt.52.1683671669113; Tue, 09 May 2023 15:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683671669; cv=none; d=google.com; s=arc-20160816; b=J7aU8vAdSTO1YRAY9KMP7GwlrUYxfb//mHr6aTGT2ZSzUnCnuh6VXJ+aFrsSDredmU j9GHdotq3keGiBnQbDT3PYmgh6ksFgwQqk/hJyVsoevfXnhLo59niLHIVXdqW3tx6BQS YpSd5HCDMhAqfhmnOd0tMpqbPfwCjVQ2zECgZ7TJPiRmpa/VWxH69/nVkKoWCamkFu7G 8+vaa0Q/6xVAlssQTy/F8DoWmLfxE9JxPjtWZ4mWa9sOtMcN/XqzQDvksfvKSsOZ0YUE nCfsiGA6cZwuwUTNTPJy061FGnZ1wdj/IiVS1eZw2hAonFwck2eLMBxhfwRQoLB694as q/6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=AS+fKVGuPLb0PNBw40EVQclmhLUg9m8EqlylUBoJ6/4=; b=UtuXIkLf2FWkf/CQiuNHI5cInifnKlctb42Oz8FtukeSoCS0gV03PxS79VFJqvGaBW 2/b/I2izPse6R6TA8emjfVA5obcXTVgTc8EqcqTTNnsR9czf1Dio3MXp4bkxotahU0J2 bbTh4MgC7+xEAo/WULGRcp7nUsNKKBxXUv4d8DIJqqMOllYKXrZWF+LCksu7kyaoYlpl JyWapKYZ/5DSkm3r1Juhv2ItkOoMuazd/xqiXMLh7h86AcJMPNSkmY+/15H2gdYtlpP4 Ouf1xI2WQ/IBAN7Xiz4JupLdcBiX9rjD5oDnn5pOkPBj7m2k/zPOYerWFQiy6t29Luni ftgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i6OJWNtS; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a170902c40700b001ac5dd95bc5si2601040plk.476.2023.05.09.15.34.15; Tue, 09 May 2023 15:34:29 -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=@redhat.com header.s=mimecast20190719 header.b=i6OJWNtS; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235913AbjEIViz (ORCPT + 99 others); Tue, 9 May 2023 17:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235006AbjEIVix (ORCPT ); Tue, 9 May 2023 17:38:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E81421BCC for ; Tue, 9 May 2023 14:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683668278; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AS+fKVGuPLb0PNBw40EVQclmhLUg9m8EqlylUBoJ6/4=; b=i6OJWNtSV7dUOHbCWwCaLo0EIKZGy1faXPIFTvdfYPxNNVm2hOdSkDq+qQhp5DP86LkMsx WhgMxOFb8h8MuKScG1F0Wyi4PjZiPKOZFLftLV6GYolLcrKetqo2dEAt18yMpe9KxqGWVH Vqy93JlZr1TzgM3jv7LdbsNwLHG8a0A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-540-lCcqVZ60OkWva9VAe79vjw-1; Tue, 09 May 2023 17:37:56 -0400 X-MC-Unique: lCcqVZ60OkWva9VAe79vjw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8CCF10115E0; Tue, 9 May 2023 21:37:55 +0000 (UTC) Received: from [10.22.16.30] (unknown [10.22.16.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97775C15BA0; Tue, 9 May 2023 21:37:55 +0000 (UTC) Message-ID: Date: Tue, 9 May 2023 17:37:55 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 03/32] locking/lockdep: lockdep_set_no_check_recursion() Content-Language: en-US To: Kent Overstreet Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Ingo Molnar , Will Deacon , Boqun Feng References: <20230509165657.1735798-1-kent.overstreet@linux.dev> <20230509165657.1735798-4-kent.overstreet@linux.dev> <20230509193147.GC2148518@hirez.programming.kicks-ass.net> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 5/9/23 16:35, Kent Overstreet wrote: > 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. OK, you can mention that in the commit log then. Cheers, Longman