lkml.org 
[lkml]   [2019]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@lca.pw>
> Signed-off-by: Yuyang Du <duyuyang@gmail.com>

Thanks!

\
 
 \ /
  Last update: 2019-07-09 15:46    [W:0.054 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site