All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Yuyang Du <duyuyang@gmail.com>
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
Date: Tue, 9 Jul 2019 15:45:42 +0200	[thread overview]
Message-ID: <20190709134542.GE3402@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190709101522.9117-1-duyuyang@gmail.com>

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 <cai@lca.pw>
> Signed-off-by: Yuyang Du <duyuyang@gmail.com>

Thanks!

  reply	other threads:[~2019-07-09 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09 10:15 [PATCH] locking/lockdep: Fix lock used or unused stats error Yuyang Du
2019-07-09 13:45 ` Peter Zijlstra [this message]
2019-07-13 11:14 ` [tip:locking/urgent] " tip-bot for Yuyang Du

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190709134542.GE3402@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=arnd@arndb.de \
    --cc=cai@lca.pw \
    --cc=duyuyang@gmail.com \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.