Re: "BUG: MAX_LOCKDEP_ENTRIES too low" with 6979 "&type->s_umount_key"

From: Waiman Long
Date: Sat May 16 2020 - 21:16:29 EST


On 5/15/20 1:21 AM, Qian Cai wrote:
Lockdep is screwed here in next-20200514 due to "BUG: MAX_LOCKDEP_ENTRIES too low". One of the traces below pointed to this linux-next commit,

8c8e824d4ef0 watch_queue: Introduce a non-repeating system-unique superblock ID

which was accidentally just showed up in next-20200514 along with,

46896d79c514 watch_queue: Add superblock notifications

I did have here,

CONFIG_SB_NOTIFICATIONS=y
CONFIG_MOUNT_NOTIFICATIONS=y
CONFIG_FSINFO=y

While MAX_LOCKDEP_ENTRIES is 32768, I noticed there is one type of lock had a lot along,

# grep 'type->s_umount_keyâ /proc/lockdep_chains | wc -l
6979

The lock_list table entries are for tracking a lock's forward and backward dependencies. The lockdep_chains isn't the right lockdep file to look at. Instead, check the lockdep files for entries with the maximum BD (backward dependency) + FD (forward dependency). That will give you a better view of which locks are consuming most of the lock_list entries. Also take a look at lockdep_stats for an overall view of how much various table entries are being consumed.

Cheers,
Longman