Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6330520rwr; Tue, 9 May 2023 13:38:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7g0qwiOj62ZEFb5RQmb3Wa1jZ0LvqMT0LKEwMWltb4q46bI7k0y1fhdCvCsntOnwzs7PtM X-Received: by 2002:a17:902:f7cd:b0:1aa:fb67:b943 with SMTP id h13-20020a170902f7cd00b001aafb67b943mr14260399plw.62.1683664684111; Tue, 09 May 2023 13:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683664684; cv=none; d=google.com; s=arc-20160816; b=t8Q44r6yYh7uDwcgO7v+NNFApVD9G1pLPorfF1XIYgizHIKdbc1Sr8cAKsW6NbjfUo 2QIrc/w2NW+RnxcctsEbw9QIrahFrUvBVizhTow3LzvnGZlO3UQkPBSO5iU/GClMXD0T 3Va7rOxDVE9pkHQRcTG3JZokjQ2gWPI5vEJ0iZK2RiYQMGyVDW1uTKbhmY2Wy09BDl+y hQeWWdB6JRzfz42gB3kbJQiqWyGWMNhOI0+v1axpQ5MtB9Pbas5h4OrUL2nz+Yno2DGP yMkrEKTEEQ9Sxo6kaBsLgqNHJebG3a8h4TBh+HeeAKI56KCClu20FaN+MH4EFmx2yJIA Z3cg== 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=lxZpyzEfcn2FNFCbnX4Bm747Ok1kXJdow2Un/gyXnX8=; b=r3De40JFt5Vj4tKkrgTT9MP5OP1ulUej92dvC5vNkht1ZmYWx2IgW28xQ8EqDpIOzC hfSZAQ59ysanw8z+LlQWrY7tfwyaxGrXbrAAG97WyHibZvSCemRb3jNP8LjS0e5DPmSj l+FbghEw0yOvzDA0tTkEtlJsQFNipIANO/rVbZI9hotdTuaWAdRvJYn8FLrVMglw6Yln D76QctmlKIh5yRBGhZpuUr1hE9rqCAy5SVjPIXt8MsJyeM7ipd+G47phJhhSomUE2wOL 2HValcb7iKXv+aA/MO0A8b5LVm6IyUC4oI42WQjFOE1Pd7IdyAou3zuXDfmbmCPYoTC0 xEzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SjcNr59m; 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 m14-20020a170902db0e00b001aafec82436si2385411plx.204.2023.05.09.13.37.51; Tue, 09 May 2023 13:38:04 -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=SjcNr59m; 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 S230345AbjEIU2l (ORCPT + 99 others); Tue, 9 May 2023 16:28:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbjEIU2j (ORCPT ); Tue, 9 May 2023 16:28:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9EA940EB for ; Tue, 9 May 2023 13:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683664074; 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=lxZpyzEfcn2FNFCbnX4Bm747Ok1kXJdow2Un/gyXnX8=; b=SjcNr59m37DGUExOoAsui4+nxp2rjMPneojtG283QC5vFlVmbbcywKzdKC9/J5GG6vA+77 YvykUe10Q4axFKWh5RFrY+27Tm6N0kCcgtVADt0Hkwtw6Z/xmOWqPaFWu6kITHAKDXnInp X09BapHXaqeVuAw8F5LvN3O8wJGa/wg= 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-621-xbO7DSw7MRmHYo0FHuzFMw-1; Tue, 09 May 2023 16:27:47 -0400 X-MC-Unique: xbO7DSw7MRmHYo0FHuzFMw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1691E185A79C; Tue, 9 May 2023 20:27:47 +0000 (UTC) Received: from [10.18.17.153] (dhcp-17-153.bos.redhat.com [10.18.17.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id D51B92026D16; Tue, 9 May 2023 20:27:46 +0000 (UTC) Message-ID: Date: Tue, 9 May 2023 16:27:46 -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 , Peter Zijlstra Cc: 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.4 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,SPF_HELO_NONE,SPF_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cheers, Longman