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 D3FBDC64EC7 for ; Mon, 13 Feb 2023 15:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbjBMP0F (ORCPT ); Mon, 13 Feb 2023 10:26:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbjBMP0B (ORCPT ); Mon, 13 Feb 2023 10:26:01 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id D1C88FF06 for ; Mon, 13 Feb 2023 07:25:59 -0800 (PST) Received: (qmail 909803 invoked by uid 1000); 13 Feb 2023 10:25:59 -0500 Date: Mon, 13 Feb 2023 10:25:59 -0500 From: Alan Stern To: Peter Zijlstra 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: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? Alan Stern