Re: [PATCH 1/4 v6] lib: debugobjects: export max loops counter

From: Thomas Gleixner
Date: Mon Feb 12 2018 - 10:04:39 EST


On Tue, 6 Feb 2018, Yang Shi wrote:
> @@ -720,7 +721,7 @@ static void __debug_check_no_obj_freed(const void *address, unsigned long size)
> enum debug_obj_state state;
> struct debug_bucket *db;
> struct debug_obj *obj;
> - int cnt;
> + int cnt, max_loops = 0;
>
> saddr = (unsigned long) address;
> eaddr = saddr + size;
> @@ -765,7 +766,12 @@ static void __debug_check_no_obj_freed(const void *address, unsigned long size)
>
> if (cnt > debug_objects_maxchain)
> debug_objects_maxchain = cnt;
> +
> + max_loops += cnt;

I don't think max_loops is the proper name for this. It's not counting
loops. It's counting the aggregate number of objects inspected for a single
invocation of __debug_check_no_obj_freed() while max_chain records the
chain length in a hash bucket corresponding to a single memory chunk. I'll
fix that up myself. No need to resend.

Thanks,

tglx