Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1526193rdh; Fri, 24 Nov 2023 15:29:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGATZSRQ8CWKXbqBagMK2OM1bLHo5o1mkD1GBELXAI/xBgOx6vdmP9G+SXW0D4VDhuL/PuM X-Received: by 2002:a92:cc49:0:b0:35c:8738:7e52 with SMTP id t9-20020a92cc49000000b0035c87387e52mr472066ilq.4.1700868593208; Fri, 24 Nov 2023 15:29:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700868593; cv=none; d=google.com; s=arc-20160816; b=gQdajkzVTHtor52qnGEi+3LFpqwds8LJgfJFEXDyJyrHhj6JN31i9QW31PLHO/BbpE h44r64o6WLL/MvaKUqpeZcg/sGf7cclizhe0yqCL3q1YhBXDHUn8m8HG1BgEQdr36vmL WQk7BGEXDO0JzK0oZZCWdjgxnsZ9RWvc6ObkGUG8HUGXl90uNi80NgKYid0+V7Z/lNdZ itN/niJGE2xhRdcIDo4E2IvSFgVXI3K/VYyN620bAOIXYseHBgX2HyRC3N3H0+2KD421 WFOESMOFg4MFPjaFnAEIRan7H8smqLz9ACGc/WuUcBqR1yVKr9x1qhRe2CHyLOt4+XzA Fakg== 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=/EGZD8n89wHgJ0e26+cxY5z+06768yEOt+oTNbIHBYA=; fh=1Bz/jPCfl7ymnniCZco6gT/NZG8vNAjvw7j56QEP9b4=; b=Jj5QigQk2iXt23/5PucXRj0qhmGopng/UtmPVJfjqsW3duETxoHgQt6BBalkPSWWI4 78t0rSSon283UwEKFtPstymNoAapp2GG7/uXE7+Z30R6pSIKrWuqZ8glZO8gXoHW+DiX nEEXgDPqKGWYF4JEmYdSrl1sRHXiMNB5t3oqqp6Xkcsy7mhMF4Fo7aD3ffw+JvzP+n7D hlQ621l+rJMLEctU9MaGdEKc3WAEIHjno7Fsvhj6O7iQ6GFIak3ICvOHCLiDhUEr5pOn csbywQwrTQdEEys6LZQpVjHDn5VDg/fSAV3PpNyhJ/BFR7oGM5XkTDhiYz54dSBNqFKn Y7ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JAL5I4ln; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e28-20020a63545c000000b005bd3d377a54si4492351pgm.123.2023.11.24.15.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 15:29:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JAL5I4ln; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A41628026C2B; Fri, 24 Nov 2023 15:29:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231521AbjKXX3e (ORCPT + 99 others); Fri, 24 Nov 2023 18:29:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjKXX3c (ORCPT ); Fri, 24 Nov 2023 18:29:32 -0500 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C46081987 for ; Fri, 24 Nov 2023 15:29:38 -0800 (PST) Date: Fri, 24 Nov 2023 18:29:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700868576; 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=/EGZD8n89wHgJ0e26+cxY5z+06768yEOt+oTNbIHBYA=; b=JAL5I4lnCAu68RX7Qa8cbnog5QL6gWHrJung9W66xlxroty3l8wzSyyPAe+yNzbglwQNP5 XNqacQyIKxY4axkYGw9T6dSbEEFOUG9g8m4C/XQ1K0wo2QMK6sWOxOmK2+ZtInyFZI6HNA ZS77nxMwHsSG/Le2UTm1S8nSdD7hNAI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Peter Zijlstra 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: <20231124232932.7kgjwi6s2h5oo4a2@moria.home.lan> References: <20231122235113.180132-1-kent.overstreet@linux.dev> <20231122235113.180132-3-kent.overstreet@linux.dev> <20231124095804.GO3818@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124095804.GO3818@noisy.programming.kicks-ass.net> X-Migadu-Flow: FLOW_OUT 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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 24 Nov 2023 15:29:51 -0800 (PST) On Fri, Nov 24, 2023 at 10:58:04AM +0100, Peter Zijlstra wrote: > 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. That was never merged? I've been meaning to revisit that though and convert some other things to it, the original patchset just converted bcache, not bcachefs. But it's not applicable here, bcachefs doesn't have lock ordering, it has cycle detection. > Additionally there is the wound-wait mutexes that also have semantics > similar to what you describe. Yeah, we talked about that as well. Wait/wound is similar in principle but aborts much more frequently, since it's just comparing transaction start time and not doing full cycle detection.