From: Qi Zheng The unused huge shrinklist shares the default list_lru lock class with the dentry LRU. Although they use distinct lock instances, lockdep conflates their dependencies and reports a circular locking dependency: WARNING: possible circular locking dependency detected Give the unused huge shrinklist a dedicated lock class to fix this false-positive lockdep warning. Fixes: b9b1861d4f7a ("mm: shmem: make unused huge shrinker memcg aware") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202610091403.d1d8080b-lkp@intel.com Signed-off-by: Qi Zheng --- mm/shmem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 5a9bcc7c66926..a6e3c9c7f72da 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -5164,6 +5164,9 @@ static const struct dentry_operations shmem_ci_dentry_ops = { static int shmem_fill_super(struct super_block *sb, struct fs_context *fc) { +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + static struct lock_class_key shmem_unused_huge_lock_key; +#endif struct shmem_options *ctx = fc->fs_private; struct inode *inode; struct shmem_sb_info *sbinfo; @@ -5243,7 +5246,8 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc) goto failed; #ifdef CONFIG_TRANSPARENT_HUGEPAGE - if (list_lru_init_memcg(&sbinfo->shrinklist, sb->s_shrink)) + if (list_lru_init_memcg_key(&sbinfo->shrinklist, sb->s_shrink, + &shmem_unused_huge_lock_key)) goto failed; #endif -- 2.54.0