Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7947408ybi; Tue, 9 Jul 2019 06:47:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGUiiSMbXzHEo764aOZKovqenRSC4sYjlqVxaQpY2kDT7d1mJTcvD8dI1B3Vd4EOOdSm40 X-Received: by 2002:a63:ea50:: with SMTP id l16mr7493769pgk.160.1562680019850; Tue, 09 Jul 2019 06:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562680019; cv=none; d=google.com; s=arc-20160816; b=nBvU2LNz55KVqy/3Wxo/rdEbOlKSGsRfLWfaZCREi/+S3wnbN8JyEVlYmOHeYZHXKp F2nHAL7w2owEJxv0XENVtjDMX3eMGNrnS28DQM6+xsKdsxkx69mo69/z+9T5Eovx2X7W hGtYBJnXqV+2eJP5OA3XD7d78+ii2R0nQFPbCWKCQM4+ghRZG4mVNw2UndIkjvb4x075 17vnlE+yMbztClRGfcTCEclEaLwS1DR9KS9BZ7oHrHfOOFqJ5B14EmNQi72Z8p7dfP0P aViss7XvCyMR/nZvQHlkpon+DpQ/4cFp09Ssmoubq7Hm44jRjqk4tYPv+CFf9eqV9L7r 6iMA== 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=nZgy+BqTOIJcy5TYK73FngoSKvFB8Vl2NL5heGDPFZ0=; b=KBEpaK7QVgowiui4eMxwz11TLf6wKEBvR3vrMDGElw13zdb8P4xFkgYi8kvAvOqH0O TVAjJ5PPmBZycs5wd9sscRP98NXunqi4sO0CmCfNlfHyUP+ZdcHESTAAXOwi3RSNgqz2 2W2jh31/6OdRFvaP91MtUTPM3WUDAgQhiA4h7H4EjbeiV1SccAFdr4m9EPNe7meVqg+X OswK/HaJM8KMcOwc/leMXehlXRsQsY+sTm2/kO9m/J+ZNER4JnYRjqz5enmy6c1N2vKG PL0heFQgWtmBD4cYjsaU7e6ZejP+sMgYOlHHkxlO0pln397D8vfYGPxGKwlvfCw+4yF3 yhqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VoB4E+NL; 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 t5si19909691pgv.164.2019.07.09.06.46.38; Tue, 09 Jul 2019 06:46: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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VoB4E+NL; 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 S1727035AbfGINps (ORCPT + 99 others); Tue, 9 Jul 2019 09:45:48 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54794 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfGINps (ORCPT ); Tue, 9 Jul 2019 09:45:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nZgy+BqTOIJcy5TYK73FngoSKvFB8Vl2NL5heGDPFZ0=; b=VoB4E+NLP8Zw1Wncbb5g7l3dm Z5zyGW5ZfgY7bwlPzA6af9a50zladxhORhX1WZ+g4HISfOcrmBTznGZMcAmBeWTaKDFVDapbDa9v+ qtEjJ2saH3h8aaWWzezwgJHKSwpvce5hCPHCazlYIqdlqopBiqJcntaHLjrfdmDEY1G68q/+jU7g5 lyqxH8vaeabC5nXFAcg164XCh9PbZelPsbqlBB06WIwFgiawed7+Z6ZWbc8AdlcwxagmQEuiAdiJZ evVAwsW/RE7q/CJ9Y5sQIx5t01QxCp90nVcBu5Ei5BUk++prXdC/aaxyQj8nTvhBGnlMvBmz2vORj Be58gfdTQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hkqRE-0005sg-6F; Tue, 09 Jul 2019 13:45:44 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7A08620976D60; Tue, 9 Jul 2019 15:45:42 +0200 (CEST) Date: Tue, 9 Jul 2019 15:45:42 +0200 From: Peter Zijlstra To: Yuyang Du Cc: will.deacon@arm.com, mingo@kernel.org, linux-kernel@vger.kernel.org, frederic@kernel.org, arnd@arndb.de, cai@lca.pw Subject: Re: [PATCH] locking/lockdep: Fix lock used or unused stats error Message-ID: <20190709134542.GE3402@hirez.programming.kicks-ass.net> References: <20190709101522.9117-1-duyuyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190709101522.9117-1-duyuyang@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 09, 2019 at 06:15:22PM +0800, Yuyang Du wrote: > The stats variable nr_unused_locks is incremented every time a new lock > class is register and decremented when the lock is first used in > __lock_acquire(). And after all, it is shown and checked in lockdep_stats. > > However, under configurations that either CONFIG_TRACE_IRQFLAGS or > CONFIG_PROVE_LOCKING is not defined: > > The commit: > > 091806515124b20 ("locking/lockdep: Consolidate lock usage bit initialization") > > missed marking the LOCK_USED flag at IRQ usage initialization because > as mark_usage() is not called. And the commit: > > 886532aee3cd42d ("locking/lockdep: Move mark_lock() inside > CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING") > > further made mark_lock() not defined such that the LOCK_USED cannot be > marked at all when the lock is first acquired. > > As a result, we fix this by not showing and checking the stats under such > configurations for lockdep_stats. > > Reported-by: Qian Cai > Signed-off-by: Yuyang Du Thanks!