From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4224C77B75 for ; Tue, 9 May 2023 20:28:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbjEIU2h (ORCPT ); Tue, 9 May 2023 16:28:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjEIU2f (ORCPT ); Tue, 9 May 2023 16:28:35 -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 C4D6640E4 for ; Tue, 9 May 2023 13:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683664072; 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=IL90DED0fhhF9I/NIw7eMI0lvs9GrJeEDSJMetvxKT78Dagd4kBqa/ioZai13PVcHEyjpZ Ty3yboW/Ga8S4BBNpHpzdv+Ed2B+noKfG+h1VHc9oXPMM04tA1Zfw9VlCWzZ0NYw+RJIVN Ax4oiCz6gb+RR6IXRoRgoawMNZObzB0= 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 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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