Re: [PATCH v3] lockdep: Allow tuning tracing capacity constants.
From: Peter Zijlstra
Date: Wed Nov 18 2020 - 10:10:51 EST
On Wed, Nov 18, 2020 at 11:30:05PM +0900, Tetsuo Handa wrote:
> The problem is that we can't know what exactly is consuming these resources.
> My question is do you have a plan to make it possible to know what exactly is
> consuming these resources.
I'm pretty sure it's in /proc/lockdep* somewhere.
IIRC you were suffering from "MAX_LOCKDEP_ENTRIES too low!", which you
find in alloc_list_entry(), that's used in add_lock_to_list(), which in
turn is used in check_prev_add() to add to ->locks_after and
->locks_before.
/me frobs in lockdep_proc.c and finds l_show() uses locks_after,
l_show() is the implementation for /proc/lockdep.
So something like:
$ grep "^ ->" /proc/lockdep | wc -l
5064
Should be roughly half (it only shows the forward dependencies) the
number of list_entries used.
/proc/lockdep_stats: direct dependencies: 11886 [max: 32768]
gives the number of list_entries used
Trick then is finding where they all go, because as you can see, my
machine is nowhere near saturated, even though it's been running a few
days.
So, go forth and analyize your problem.