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 AC93DC636CC for ; Mon, 13 Feb 2023 16:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230301AbjBMQaU (ORCPT ); Mon, 13 Feb 2023 11:30:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbjBMQaS (ORCPT ); Mon, 13 Feb 2023 11:30:18 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6B43CA3E; Mon, 13 Feb 2023 08:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/jpzmFmR14mwSujj3n1pCkQjIdWQn+MW6tAFvblUhZ4=; b=YDaAKgX/l/9P0rB3ye5IyhJ+ww kuoen+vlsp75J+8MMGQmCxcy/Hv8Xqg151r7UauYZH2t3dhcuQf8tBaEgnZURYv/Sxo++j0i3488s RS/tqfT/i9ipw9VI2ZzIMaAOHncyKvoCP3rdR+ZuVksXTbkD+Asv4ixMT+gcCN10jQxoF4j1DowFF MnYHUUkjnC+8vmwfOfMejQrZGe5U/kklmwgvo0ZDDsrMuYihWWfafJwJg7P8tb/RztFe9UmLg51jx mQbUc4ETtpayJ3lneHGvpYN98VAhj51+elntt/havXk4R/1DvfdnGP4hg4G/Nkz+KRUHJoE1nYnYP BYj4Lh+w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRbiA-005vCP-VW; Mon, 13 Feb 2023 16:29:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EB2E030036B; Mon, 13 Feb 2023 17:29:49 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CB466200E0489; Mon, 13 Feb 2023 17:29:49 +0100 (CET) Date: Mon, 13 Feb 2023 17:29:49 +0100 From: Peter Zijlstra To: Alan Stern Cc: Kent Overstreet , Kent Overstreet , Linus Torvalds , Coly Li , Tetsuo Handa , syzkaller , Dmitry Vyukov , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Boqun Feng , LKML , USB list , Hillf Danton Subject: Re: [PATCH RFC] drivers/core: Replace lockdep_set_novalidate_class() with unique class keys Message-ID: References: <109c3cc0-2c13-7452-4548-d0155c1aba10@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 13, 2023 at 10:25:59AM -0500, Alan Stern wrote: > On Mon, Feb 13, 2023 at 10:24:13AM +0100, Peter Zijlstra wrote: > > On Sun, Feb 12, 2023 at 10:23:44AM -0500, Alan Stern wrote: > > > Provided it acquires the parent device's lock first, this is > > > utterly safe no matter what order the children are locked in. Try > > > telling that to lockdep! > > > > mutex_lock_next_lock(child->lock, parent->lock) is there to express this > > exact pattern, it allows taking multiple child->lock class locks (in any > > order) provided parent->lock is held. > > Ah, this is news to me. Is this sort of thing documented somewhere? Probably not :/