Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1567311ybi; Wed, 19 Jun 2019 23:35:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD68Xi34jmiJbwvQMFjtGm7E+Cet8cnn/M3wiBGMZCdNQXRaHLrDzObKFnjQxw4KjE/qGi X-Received: by 2002:a17:90a:22c6:: with SMTP id s64mr1442313pjc.5.1561012559488; Wed, 19 Jun 2019 23:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561012559; cv=none; d=google.com; s=arc-20160816; b=mwbMjG0HqMsOTmKvqH448IzH0BwFrgVEzmOknfci0UBHCJzW5oFZNAyqK2Sh5ciLTF rPe16JrRxkyWrNytgv1IDTAHOWkxb/7LGtuksu7lH72AyRGK1NJYau+uw26aIOSIMXy4 zjwMZaj5k/Etc6flEC3edC5vchI9xhFFTOgjOK/SfyAghhaUvphDxkigwPH2MU0blp1Z SLfyZyBQhrq5GPC8jkcWJ7CWUFUsIERPmhStqn3eN28E0MJ3nFFJN+QpKya/rZ6CdIEn vAJwuU6GWpI2menuopTkcHBQ8YC5q9ViPzCwjmY1DWfQQc4hd+BP4Rinnu4A1KTzVgvl 2qvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ck34MqYLMG9sCIjSe7jfIm8c9SGUe4HfeCvZARW168M=; b=h90OMGYUz6b0UDuYWP7gA7jt8S7oBSaYvPFK8nvjbyNIQf8L2EQ9kJ9nQpMbfgzE2N cHu5GJmocTrdomv3+pHWh72QsLKTV5GnJ9k4MYMa7cDvbPHC5XorzVnakGVOdp0tSbh/ 6PeXAbKcVSHtk/9t0EIm83bkLVZDIVX7ot6aiATTQvqcb9VTHlMMmbjUzDl33RAjYJ7W NBQUaoKrMVwsZ7ZOSIgJ6BWZQnOuFxoCO1NymET24bj9roIGWsdwrjSY5SsDyXzK7UHL RWhGBIBcNPEkdKM9zMOIiNN31SQdUKrydTWZdlPpbQDxYs0gkn/lzOvfZfuFhNto5Tk4 CsBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lFM3+3jh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21si8205579pll.369.2019.06.19.23.35.43; Wed, 19 Jun 2019 23:35:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lFM3+3jh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726379AbfFTGeM (ORCPT + 99 others); Thu, 20 Jun 2019 02:34:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:34302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfFTGeL (ORCPT ); Thu, 20 Jun 2019 02:34:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 515C62070B; Thu, 20 Jun 2019 06:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561012450; bh=Ho986ZwEwN6lSqW02CRO5TRKTGH2igmUfY7a/ULtRRU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lFM3+3jhB60zvG/6yB5IE5B3Rx+VKwvPqzhLzTvAMHSgLqGN5c7UT/x7JJ1TuJGVF lVevF4s7TKlP8/Hj+yX54QMnBdPlf/MMKzNcCIdDbj9TeGMDC6DOu+5ILxmtYZrzRg godWZUUe0caVwlu6le/5vxZ5bW96eLKozu4FLnhk= Date: Thu, 20 Jun 2019 08:34:08 +0200 From: Greg Kroah-Hartman To: Dan Williams Cc: linux-nvdimm , Ingo Molnar , Ira Weiny , Will Deacon , Dave Jiang , Keith Busch , Peter Zijlstra , Vishal Verma , "Rafael J. Wysocki" , Linux Kernel Mailing List Subject: Re: [PATCH 6/6] driver-core, libnvdimm: Let device subsystems add local lockdep coverage Message-ID: <20190620063408.GA4768@kroah.com> References: <156029554317.419799.1324389595953183385.stgit@dwillia2-desk3.amr.corp.intel.com> <156029557585.419799.11741877483838451695.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 19, 2019 at 03:21:58PM -0700, Dan Williams wrote: > On Tue, Jun 11, 2019 at 4:40 PM Dan Williams wrote: > > > > For good reason, the standard device_lock() is marked > > lockdep_set_novalidate_class() because there is simply no sane way to > > describe the myriad ways the device_lock() ordered with other locks. > > However, that leaves subsystems that know their own local device_lock() > > ordering rules to find lock ordering mistakes manually. Instead, > > introduce an optional / additional lockdep-enabled lock that a subsystem > > can acquire in all the same paths that the device_lock() is acquired. > > > > A conversion of the NFIT driver and NVDIMM subsystem to a > > lockdep-validate device_lock() scheme is included. The > > debug_nvdimm_lock() implementation implements the correct lock-class and > > stacking order for the libnvdimm device topology hierarchy. > > Greg, Peter, > > Any thoughts on carrying this debug hack upstream? The idea being that > it's impossible to enable lockdep for the device_lock() globally, but > a constrained usage of the proposed lockdep_mutex has proven enough to > flush out device_lock deadlocks from libnvdimm. > > It appears one aspect that is missing from this patch proposal is a > mechanism / convention to make sure that lockdep_mutex has constrained > usage for a given kernel build, otherwise it's obviously just as > problematic as device_lock(). Other concerns? Yeah, it feels a bit hacky but it's really up to a subsystem to mess up using it as much as anything else, so user beware :) I don't object to it if it makes things easier for you to debug. thanks, greg k-h