Re: [PATCH v5 11/15] locking/lockdep: Check data structure consistency

From: Peter Zijlstra
Date: Thu Jan 10 2019 - 10:51:56 EST


On Mon, Dec 17, 2018 at 01:29:58PM -0800, Bart Van Assche wrote:
> Debugging lockdep data structure inconsistencies is challenging. Add
> disabled code that verifies data structure consistency at runtime.
>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Waiman Long <longman@xxxxxxxxxx>
> Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
> kernel/locking/lockdep.c | 183 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 183 insertions(+)
>
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 3a63142d4764..d411660572e1 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -74,6 +74,8 @@ module_param(lock_stat, int, 0644);
> #define lock_stat 0
> #endif
>
> +static bool check_data_structure_consistency;

Should this maybe be CONFIG_DEBUG_LOCKDEP ?