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 50391C05027 for ; Sat, 18 Feb 2023 03:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjBRDV2 (ORCPT ); Fri, 17 Feb 2023 22:21:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjBRDV1 (ORCPT ); Fri, 17 Feb 2023 22:21:27 -0500 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92C3C241F1 for ; Fri, 17 Feb 2023 19:21:25 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1676690483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=MQ8E3wieQMRLTMS9kx80LuFa1UjY4riWLnMnBzHBE/0=; b=SIYgzqNxL87bQsN/n0LLTGALWY+qPp/bkcxxiI9dROcF4pm9dBLvjA6e6vbJGpDi90oaut Iyj75XKHRN6rHj2t4LR6+uvFaHK9wwYDDbCQ8Fnd6REnUkakDvenLOLFHl3dA4Ef0YuXsh CnEUOoksQBbYel2NPvPIHolG//1DwJw= From: Kent Overstreet To: linux-kernel@vger.kernel.org, peterz@infradead.org Cc: Kent Overstreet , mingo@redhat.com, stern@rowland.harvard.edu Subject: [PATCH 0/2] lockdep lock comparison function Date: Fri, 17 Feb 2023 22:21:15 -0500 Message-Id: <20230218032117.2372071-1-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch implements the lock comparison function I've been talking about, and converts one of bcache's locks to use it. b->write_lock has different locking rules; I'm not sure there's an easy way to get rid of lockdep_set_novalidate_class for it - but the code has changed and my memory is foggy. I'd like it if we could convert existing uses of *_lock_nested() to this approach, since it's more rigorous and IMO, much clearer. That'll require looking at specific use cases, though - the inode lock in fs/inode.c is the only one I looked at and it's got a lot of nutty stuff going on. Kent Overstreet (2): lockdep: lock_set_lock_cmp_fn() bcache: Convert to lock_cmp_fn drivers/md/bcache/btree.c | 15 ++++++++++- drivers/md/bcache/btree.h | 4 +-- include/linux/lockdep.h | 8 ++++++ include/linux/lockdep_types.h | 6 +++++ kernel/locking/lockdep.c | 51 ++++++++++++++++++++++++++++++++++- 5 files changed, 80 insertions(+), 4 deletions(-) -- 2.39.2