[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190709134542.GE3402@hirez.programming.kicks-ass.net>
Date: Tue, 9 Jul 2019 15:45:42 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Yuyang Du <duyuyang@...il.com>
Cc: will.deacon@....com, mingo@...nel.org,
linux-kernel@...r.kernel.org, frederic@...nel.org, arnd@...db.de,
cai@....pw
Subject: Re: [PATCH] locking/lockdep: Fix lock used or unused stats error
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@....pw>
> Signed-off-by: Yuyang Du <duyuyang@...il.com>
Thanks!
Powered by blists - more mailing lists