b9b1861d4f: WARNING:possible_circular_locking_dependency_detected
Subsystems (2)
kernel test robot
build botHello,
kernel test robot noticed "WARNING:possible_circular_locking_dependency_detected" on:
commit: b9b1861d4f7ae63b15228c744d504a86ab48a5a2 ("mm: shmem: make unused huge shrinker memcg aware") https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
[test failed on linux-next/master f5f84daefcd92d7a630066635ecea1433ed5eac7]
in testcase: boot
config: i386-randconfig-053-20260902
compiler: clang-22
test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 4 -m 4G
(please refer to attached dmesg/kmsg for entire log/backtrace)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]
[ 64.638596][ T203] ======================================================
[ 64.643742][ T203] WARNING: possible circular locking dependency detected
[ 64.649127][ T203] 7.3.0-rc4+ #1 Not tainted
[ 64.652392][ T203] ------------------------------------------------------
[ 64.657842][ T203] systemd-udevd/203 is trying to acquire lock:
[ 64.663589][ T203] f5835900 (&sb->s_type->i_lock_key){+.+.}-{3:3}, at: igrab+0x44/0xc0
[ 64.669221][ T203]
[ 64.669221][ T203] but task is already holding lock:
[ 64.669221][ T203]
[ 64.669221][ T203] but task is already holding lock:
[ 64.669221][ T203]
[ 64.669221][ T203] but task is already holding lock:
[ 64.674183][ T203] f5c5a61c (&l->lock){+.+.}-{3:3}, at: __list_lru_walk_one+0x55/0x180
[ 64.679737][ T203]
[ 64.679737][ T203] which lock already depends on the new lock.
[ 64.679737][ T203]
[ 64.679737][ T203] which lock already depends on the new lock.
[ 64.679737][ T203]
[ 64.679737][ T203] which lock already depends on the new lock.
[ 64.679737][ T203]
[ 64.686427][ T203]
[ 64.686427][ T203] the existing dependency chain (in reverse order) is:
[ 64.686427][ T203]
[ 64.686427][ T203] the existing dependency chain (in reverse order) is:
[ 64.686427][ T203]
[ 64.686427][ T203] the existing dependency chain (in reverse order) is:
[ 64.691963][ T203]
[ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}:
[ 64.691963][ T203]
[ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}:
[ 64.691963][ T203]
[ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}:
[ 64.695874][ T203] _raw_spin_lock+0x26/0x40
[ 64.699072][ T203] list_lru_add_obj+0x3c/0xc0
[ 64.702561][ T203] d_lru_add+0x40/0x80
[ 64.705640][ T203] fast_dput+0x1c7/0x200
[ 64.708794][ T203] dput+0x25/0x40
[ 64.711603][ T203] pick_link+0x1ed/0x340
[ 64.714612][ T203] step_into_slowpath+0x1af/0x200
[ 64.718143][ T203] path_lookupat+0x109/0x1c0
[ 64.721512][ T203] filename_lookup+0xc1/0x200
[ 64.725044][ T203] user_path_at+0x2f/0xc0
[ 64.728522][ T203] __ia32_sys_mount+0x134/0x1c0
[ 64.732025][ T203] ia32_sys_call+0x39/0x14c0
[ 64.735800][ T203] __do_fast_syscall_32+0x16c/0x340
[ 64.740069][ T203] do_fast_syscall_32+0x28/0x80
[ 64.743715][ T203] do_SYSENTER_32+0x12/0x40
[ 64.747337][ T203] entry_SYSENTER_32+0x98/0xfd
[ 64.750971][ T203]
[ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}:
[ 64.750971][ T203]
[ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}:
[ 64.750971][ T203]
[ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}:
[ 64.756528][ T203] _raw_spin_lock+0x26/0x40
[ 64.760072][ T203] d_instantiate+0x34/0x80
[ 64.763562][ T203] d_make_root+0x29/0x40
[ 64.766867][ T203] shmem_fill_super+0x292/0x340
[ 64.770617][ T203] get_tree_nodev+0x3e/0x80
[ 64.774112][ T203] shmem_get_tree+0x12/0x40
[ 64.777728][ T203] vfs_get_tree+0x1e/0xc0
[ 64.781170][ T203] vfs_kern_mount+0x6e/0xc0
[ 64.784747][ T203] kern_mount+0x16/0x40
[ 64.787998][ T203] shmem_init+0x26/0x100
[ 64.791525][ T203] mnt_init+0xfd/0x140
[ 64.794594][ T203] vfs_caches_init+0x26/0x40
[ 64.798341][ T203] start_kernel+0x2df/0x380
[ 64.801707][ T203] i386_start_kernel+0xc5/0x100
[ 64.805611][ T203] startup_32_smp+0x151/0x160
[ 64.809276][ T203]
[ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}:
[ 64.809276][ T203]
[ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}:
[ 64.809276][ T203]
[ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}:
[ 64.815036][ T203] __lock_acquire+0x1851/0x2a40
[ 64.818649][ T203] lock_acquire+0x96/0x200
[ 64.821879][ T203] _raw_spin_lock+0x26/0x40
[ 64.825139][ T203] igrab+0x44/0xc0
[ 64.828067][ T203] shmem_unused_huge_isolate+0x2e/0xc0
[ 64.832099][ T203] __list_lru_walk_one+0x98/0x180
[ 64.835960][ T203] list_lru_walk_node+0x1b/0x40
[ 64.839660][ T203] shmem_unused_huge_shrink+0x62/0x500
[ 64.843880][ T203] shmem_alloc_and_add_folio+0x1b8/0x480
[ 64.847901][ T203] shmem_get_folio_gfp+0x1af/0x880
[ 64.851755][ T203] shmem_write_begin+0x5c/0x100
[ 64.855571][ T203] generic_perform_write+0xc1/0x340
[ 64.859545][ T203] shmem_file_write_iter+0x5f/0x80
[ 64.863719][ T203] vfs_write+0x263/0x340
[ 64.867230][ T203] ksys_write+0x6a/0x100
[ 64.870798][ T203] __ia32_sys_write+0x18/0x40
[ 64.874740][ T203] ia32_sys_call+0x1365/0x14c0
[ 64.878135][ T203] __do_fast_syscall_32+0x16c/0x340
[ 64.881546][ T203] do_fast_syscall_32+0x28/0x80
[ 64.885606][ T203] do_SYSENTER_32+0x12/0x40
[ 64.889087][ T203] entry_SYSENTER_32+0x98/0xfd
[ 64.892908][ T203]
[ 64.892908][ T203] other info that might help us debug this:
[ 64.892908][ T203]
[ 64.892908][ T203] other info that might help us debug this:
[ 64.892908][ T203]
[ 64.892908][ T203] other info that might help us debug this:
[ 64.892908][ T203]
[ 64.900253][ T203] Chain exists of:
[ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock
[ 64.900253][ T203]
[ 64.900253][ T203] Chain exists of:
[ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock
[ 64.900253][ T203]
[ 64.900253][ T203] Chain exists of:
[ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock
[ 64.900253][ T203]
[ 64.909551][ T203] Possible unsafe locking scenario:
[ 64.909551][ T203]
[ 64.909551][ T203] Possible unsafe locking scenario:
[ 64.909551][ T203]
[ 64.909551][ T203] Possible unsafe locking scenario:
[ 64.909551][ T203]
[ 64.915049][ T203] CPU0 CPU1
[ 64.918939][ T203] ---- ----
[ 64.922808][ T203] lock(&l->lock);
[ 64.925634][ T203] lock(&lockref->lock);
[ 64.930586][ T203] lock(&l->lock);
[ 64.934913][ T203] lock(&sb->s_type->i_lock_key);
[ 64.938686][ T203]
[ 64.938686][ T203] *** DEADLOCK ***
[ 64.938686][ T203]
[ 64.938686][ T203] *** DEADLOCK ***
[ 64.938686][ T203]
[ 64.938686][ T203] *** DEADLOCK ***
[ 64.938686][ T203]
[ 64.944491][ T203] locks held by systemd-udevd/203: 4, last CPU#0:
[ 64.949046][ T203] #0: f5c50a6c (sb_writers#6){.+.+}-{0:0}, at: vfs_write+0xb7/0x340
[ 64.954944][ T203] #1: f5655658 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: shmem_file_write_iter+0x28/0x80
[ 64.962274][ T203] #2: f5c5a61c (&l->lock){+.+.}-{3:3}, at: __list_lru_walk_one+0x55/0x180
[ 64.968148][ T203] #3: f5835810 (&info->lock){+.+.}-{3:3}, at: shmem_unused_huge_isolate+0x1f/0xc0
[ 64.974409][ T203]
[ 64.974409][ T203] stack backtrace:
[ 64.974409][ T203]
[ 64.974409][ T203] stack backtrace:
[ 64.974409][ T203]
[ 64.974409][ T203] stack backtrace:
[ 64.978786][ T203] CPU: 0 UID: 0 PID: 203 Comm: systemd-udevd Not tainted 7.3.0-rc4+ #1 PREEMPT 2f9698b0cc81084abb5f3c5754f76765d21e2bf0
[ 64.987668][ T203] Call Trace:
[ 64.990012][ T203] __dump_stack+0x18/0x40
[ 64.993281][ T203] dump_stack_lvl+0x20/0x40
[ 64.996699][ T203] dump_stack+0xd/0x12
[ 64.999644][ T203] print_circular_bug+0x2bf/0x300
[ 65.003228][ T203] check_noncircular+0xd7/0x100
[ 65.006753][ T203] __lock_acquire+0x1851/0x2a40
[ 65.009733][ T203] ? _raw_spin_unlock_irqrestore+0x20/0x80
[ 65.013953][ T203] lock_acquire+0x96/0x200
[ 65.017236][ T203] ? igrab+0x44/0xc0
[ 65.020072][ T203] _raw_spin_lock+0x26/0x40
[ 65.023308][ T203] ? igrab+0x44/0xc0
[ 65.025972][ T203] igrab+0x44/0xc0
[ 65.028647][ T203] shmem_unused_huge_isolate+0x2e/0xc0
[ 65.032472][ T203] __list_lru_walk_one+0x98/0x180
[ 65.035619][ T203] ? shmem_unused_huge_shrink+0x500/0x500
[ 65.039875][ T203] list_lru_walk_node+0x1b/0x40
[ 65.043576][ T203] ? shmem_unused_huge_shrink+0x500/0x500
[ 65.047582][ T203] shmem_unused_huge_shrink+0x62/0x500
[ 65.051774][ T203] ? shmem_inode_acct_blocks+0x218/0x280
[ 65.055593][ T203] shmem_alloc_and_add_folio+0x1b8/0x480
[ 65.059093][ T203] shmem_get_folio_gfp+0x1af/0x880
[ 65.062996][ T203] shmem_write_begin+0x5c/0x100
[ 65.066769][ T203] generic_perform_write+0xc1/0x340
[ 65.070595][ T203] shmem_file_write_iter+0x5f/0x80
[ 65.074058][ T203] vfs_write+0x263/0x340
[ 65.077047][ T203] ? shmem_file_read_iter+0x400/0x400
[ 65.081058][ T203] ksys_write+0x6a/0x100
[ 65.084028][ T203] __ia32_sys_write+0x18/0x40
[ 65.087227][ T203] ia32_sys_call+0x1365/0x14c0
[ 65.090769][ T203] __do_fast_syscall_32+0x16c/0x340
[ 65.094701][ T203] ? do_fast_syscall_32+0x28/0x80
[ 65.098687][ T203] do_fast_syscall_32+0x28/0x80
[ 65.102284][ T203] do_SYSENTER_32+0x12/0x40
[ 65.105857][ T203] entry_SYSENTER_32+0x98/0xfd
[ 65.109406][ T203] EIP: 0xa7fbbc4c
[ 65.112302][ T203] Code: c0 74 05 c1 e9 0c 89 08 31 c0 5e 5d 31 c9 31 d2 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 8d 76 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 58 b8
[ 65.127608][ T203] EAX: ffffffda EBX: 00000010 ECX: 0238cb60 EDX: 00000023
[ 65.133201][ T203] ESI: 00000023 EDI: 0238cb60 EBP: 0238a5e0 ESP: afef94f0
[ 65.138647][ T203] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00200246The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20261009/[email protected]
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Thanks for the report!
Quoted 18 lines · kernel test robot
Hello,
kernel test robot noticed "WARNING:possible_circular_locking_dependency_detected" on:
commit:
b9b1861d4f7ae63b15228c744d504a86ab48a5a2("mm: shmem: make unused huge shrinker memcg aware") https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master[test failed on linux-next/master
f5f84daefcd92d7a630066635ecea1433ed5eac7]in testcase: boot
config: i386-randconfig-053-20260902
compiler: clang-22
test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 4 -m 4G(please refer to attached dmesg/kmsg for entire log/backtrace)
Quoted 8 lines
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected][ 64.638596][ T203] ====================================================== [ 64.643742][ T203] WARNING: possible circular locking dependency detected [ 64.649127][ T203] 7.3.0-rc4+ #1 Not tainted [ 64.652392][ T203] ------------------------------------------------------
This does not look like an actual deadlock. The list_lru lock held by shmem_unused_huge_isolate() belongs to the shmem unused huge shrinklist, while the existing dependency was recorded for the dentry LRU. These are distinct lock instances.
However, both locks use the default list_lru lock class, so lockdep treats them as the same lock and combines their dependency chains.
Could you please help test whether the following change makes the lockdep warning go away?
mm/shmem.c +0 -0
@@ -5162,6 +5162,8 @@ static const struct dentry_operations
shmem_ci_dentry_ops = {
};
#endif
+static struct lock_class_key shmem_unused_huge_lock_key;
+
static int shmem_fill_super(struct super_block *sb, struct fs_context *fc)
{
struct shmem_options *ctx = fc->fs_private;
@@ -5243,7 +5245,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
Thanks,
Qi
Quoted 188 lines
[ 64.657842][ T203] systemd-udevd/203 is trying to acquire lock: [ 64.663589][ T203] f5835900 (&sb->s_type->i_lock_key){+.+.}-{3:3}, at: igrab+0x44/0xc0 [ 64.669221][ T203] [ 64.669221][ T203] but task is already holding lock: [ 64.669221][ T203] [ 64.669221][ T203] but task is already holding lock: [ 64.669221][ T203] [ 64.669221][ T203] but task is already holding lock: [ 64.674183][ T203] f5c5a61c (&l->lock){+.+.}-{3:3}, at: __list_lru_walk_one+0x55/0x180 [ 64.679737][ T203] [ 64.679737][ T203] which lock already depends on the new lock. [ 64.679737][ T203] [ 64.679737][ T203] which lock already depends on the new lock. [ 64.679737][ T203] [ 64.679737][ T203] which lock already depends on the new lock. [ 64.679737][ T203] [ 64.686427][ T203] [ 64.686427][ T203] the existing dependency chain (in reverse order) is: [ 64.686427][ T203] [ 64.686427][ T203] the existing dependency chain (in reverse order) is: [ 64.686427][ T203] [ 64.686427][ T203] the existing dependency chain (in reverse order) is: [ 64.691963][ T203] [ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}: [ 64.691963][ T203] [ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}: [ 64.691963][ T203] [ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}: [ 64.695874][ T203] _raw_spin_lock+0x26/0x40 [ 64.699072][ T203] list_lru_add_obj+0x3c/0xc0 [ 64.702561][ T203] d_lru_add+0x40/0x80 [ 64.705640][ T203] fast_dput+0x1c7/0x200 [ 64.708794][ T203] dput+0x25/0x40 [ 64.711603][ T203] pick_link+0x1ed/0x340 [ 64.714612][ T203] step_into_slowpath+0x1af/0x200 [ 64.718143][ T203] path_lookupat+0x109/0x1c0 [ 64.721512][ T203] filename_lookup+0xc1/0x200 [ 64.725044][ T203] user_path_at+0x2f/0xc0 [ 64.728522][ T203] __ia32_sys_mount+0x134/0x1c0 [ 64.732025][ T203] ia32_sys_call+0x39/0x14c0 [ 64.735800][ T203] __do_fast_syscall_32+0x16c/0x340 [ 64.740069][ T203] do_fast_syscall_32+0x28/0x80 [ 64.743715][ T203] do_SYSENTER_32+0x12/0x40 [ 64.747337][ T203] entry_SYSENTER_32+0x98/0xfd [ 64.750971][ T203] [ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}: [ 64.750971][ T203] [ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}: [ 64.750971][ T203] [ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}: [ 64.756528][ T203] _raw_spin_lock+0x26/0x40 [ 64.760072][ T203] d_instantiate+0x34/0x80 [ 64.763562][ T203] d_make_root+0x29/0x40 [ 64.766867][ T203] shmem_fill_super+0x292/0x340 [ 64.770617][ T203] get_tree_nodev+0x3e/0x80 [ 64.774112][ T203] shmem_get_tree+0x12/0x40 [ 64.777728][ T203] vfs_get_tree+0x1e/0xc0 [ 64.781170][ T203] vfs_kern_mount+0x6e/0xc0 [ 64.784747][ T203] kern_mount+0x16/0x40 [ 64.787998][ T203] shmem_init+0x26/0x100 [ 64.791525][ T203] mnt_init+0xfd/0x140 [ 64.794594][ T203] vfs_caches_init+0x26/0x40 [ 64.798341][ T203] start_kernel+0x2df/0x380 [ 64.801707][ T203] i386_start_kernel+0xc5/0x100 [ 64.805611][ T203] startup_32_smp+0x151/0x160 [ 64.809276][ T203] [ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}: [ 64.809276][ T203] [ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}: [ 64.809276][ T203] [ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}: [ 64.815036][ T203] __lock_acquire+0x1851/0x2a40 [ 64.818649][ T203] lock_acquire+0x96/0x200 [ 64.821879][ T203] _raw_spin_lock+0x26/0x40 [ 64.825139][ T203] igrab+0x44/0xc0 [ 64.828067][ T203] shmem_unused_huge_isolate+0x2e/0xc0 [ 64.832099][ T203] __list_lru_walk_one+0x98/0x180 [ 64.835960][ T203] list_lru_walk_node+0x1b/0x40 [ 64.839660][ T203] shmem_unused_huge_shrink+0x62/0x500 [ 64.843880][ T203] shmem_alloc_and_add_folio+0x1b8/0x480 [ 64.847901][ T203] shmem_get_folio_gfp+0x1af/0x880 [ 64.851755][ T203] shmem_write_begin+0x5c/0x100 [ 64.855571][ T203] generic_perform_write+0xc1/0x340 [ 64.859545][ T203] shmem_file_write_iter+0x5f/0x80 [ 64.863719][ T203] vfs_write+0x263/0x340 [ 64.867230][ T203] ksys_write+0x6a/0x100 [ 64.870798][ T203] __ia32_sys_write+0x18/0x40 [ 64.874740][ T203] ia32_sys_call+0x1365/0x14c0 [ 64.878135][ T203] __do_fast_syscall_32+0x16c/0x340 [ 64.881546][ T203] do_fast_syscall_32+0x28/0x80 [ 64.885606][ T203] do_SYSENTER_32+0x12/0x40 [ 64.889087][ T203] entry_SYSENTER_32+0x98/0xfd [ 64.892908][ T203] [ 64.892908][ T203] other info that might help us debug this: [ 64.892908][ T203] [ 64.892908][ T203] other info that might help us debug this: [ 64.892908][ T203] [ 64.892908][ T203] other info that might help us debug this: [ 64.892908][ T203] [ 64.900253][ T203] Chain exists of: [ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock [ 64.900253][ T203] [ 64.900253][ T203] Chain exists of: [ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock [ 64.900253][ T203] [ 64.900253][ T203] Chain exists of: [ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock [ 64.900253][ T203] [ 64.909551][ T203] Possible unsafe locking scenario: [ 64.909551][ T203] [ 64.909551][ T203] Possible unsafe locking scenario: [ 64.909551][ T203] [ 64.909551][ T203] Possible unsafe locking scenario: [ 64.909551][ T203] [ 64.915049][ T203] CPU0 CPU1 [ 64.918939][ T203] ---- ---- [ 64.922808][ T203] lock(&l->lock); [ 64.925634][ T203] lock(&lockref->lock); [ 64.930586][ T203] lock(&l->lock); [ 64.934913][ T203] lock(&sb->s_type->i_lock_key); [ 64.938686][ T203] [ 64.938686][ T203] *** DEADLOCK *** [ 64.938686][ T203] [ 64.938686][ T203] *** DEADLOCK *** [ 64.938686][ T203] [ 64.938686][ T203] *** DEADLOCK *** [ 64.938686][ T203] [ 64.944491][ T203] locks held by systemd-udevd/203: 4, last CPU#0: [ 64.949046][ T203] #0: f5c50a6c (sb_writers#6){.+.+}-{0:0}, at: vfs_write+0xb7/0x340 [ 64.954944][ T203] #1: f5655658 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: shmem_file_write_iter+0x28/0x80 [ 64.962274][ T203] #2: f5c5a61c (&l->lock){+.+.}-{3:3}, at: __list_lru_walk_one+0x55/0x180 [ 64.968148][ T203] #3: f5835810 (&info->lock){+.+.}-{3:3}, at: shmem_unused_huge_isolate+0x1f/0xc0 [ 64.974409][ T203] [ 64.974409][ T203] stack backtrace: [ 64.974409][ T203] [ 64.974409][ T203] stack backtrace: [ 64.974409][ T203] [ 64.974409][ T203] stack backtrace: [ 64.978786][ T203] CPU: 0 UID: 0 PID: 203 Comm: systemd-udevd Not tainted 7.3.0-rc4+ #1 PREEMPT 2f9698b0cc81084abb5f3c5754f76765d21e2bf0 [ 64.987668][ T203] Call Trace: [ 64.990012][ T203] __dump_stack+0x18/0x40 [ 64.993281][ T203] dump_stack_lvl+0x20/0x40 [ 64.996699][ T203] dump_stack+0xd/0x12 [ 64.999644][ T203] print_circular_bug+0x2bf/0x300 [ 65.003228][ T203] check_noncircular+0xd7/0x100 [ 65.006753][ T203] __lock_acquire+0x1851/0x2a40 [ 65.009733][ T203] ? _raw_spin_unlock_irqrestore+0x20/0x80 [ 65.013953][ T203] lock_acquire+0x96/0x200 [ 65.017236][ T203] ? igrab+0x44/0xc0 [ 65.020072][ T203] _raw_spin_lock+0x26/0x40 [ 65.023308][ T203] ? igrab+0x44/0xc0 [ 65.025972][ T203] igrab+0x44/0xc0 [ 65.028647][ T203] shmem_unused_huge_isolate+0x2e/0xc0 [ 65.032472][ T203] __list_lru_walk_one+0x98/0x180 [ 65.035619][ T203] ? shmem_unused_huge_shrink+0x500/0x500 [ 65.039875][ T203] list_lru_walk_node+0x1b/0x40 [ 65.043576][ T203] ? shmem_unused_huge_shrink+0x500/0x500 [ 65.047582][ T203] shmem_unused_huge_shrink+0x62/0x500 [ 65.051774][ T203] ? shmem_inode_acct_blocks+0x218/0x280 [ 65.055593][ T203] shmem_alloc_and_add_folio+0x1b8/0x480 [ 65.059093][ T203] shmem_get_folio_gfp+0x1af/0x880 [ 65.062996][ T203] shmem_write_begin+0x5c/0x100 [ 65.066769][ T203] generic_perform_write+0xc1/0x340 [ 65.070595][ T203] shmem_file_write_iter+0x5f/0x80 [ 65.074058][ T203] vfs_write+0x263/0x340 [ 65.077047][ T203] ? shmem_file_read_iter+0x400/0x400 [ 65.081058][ T203] ksys_write+0x6a/0x100 [ 65.084028][ T203] __ia32_sys_write+0x18/0x40 [ 65.087227][ T203] ia32_sys_call+0x1365/0x14c0 [ 65.090769][ T203] __do_fast_syscall_32+0x16c/0x340 [ 65.094701][ T203] ? do_fast_syscall_32+0x28/0x80 [ 65.098687][ T203] do_fast_syscall_32+0x28/0x80 [ 65.102284][ T203] do_SYSENTER_32+0x12/0x40 [ 65.105857][ T203] entry_SYSENTER_32+0x98/0xfd [ 65.109406][ T203] EIP: 0xa7fbbc4c [ 65.112302][ T203] Code: c0 74 05 c1 e9 0c 89 08 31 c0 5e 5d 31 c9 31 d2 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 8d 76 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 58 b8 [ 65.127608][ T203] EAX: ffffffda EBX: 00000010 ECX: 0238cb60 EDX: 00000023 [ 65.133201][ T203] ESI: 00000023 EDI: 0238cb60 EBP: 0238a5e0 ESP: afef94f0 [ 65.138647][ T203] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00200246The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20261009/[email protected]--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Quoted 57 lines · Qi Zheng
Thanks for the report!
Quoted 18 lines · kernel test robot
Hello,
kernel test robot noticed "WARNING:possible_circular_locking_dependency_detected" on:
commit:
b9b1861d4f7ae63b15228c744d504a86ab48a5a2("mm: shmem: make unused huge shrinker memcg aware") https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master[test failed on linux-next/master
f5f84daefcd92d7a630066635ecea1433ed5eac7]in testcase: boot
config: i386-randconfig-053-20260902
compiler: clang-22
test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 4 -m 4G(please refer to attached dmesg/kmsg for entire log/backtrace)
Quoted 8 lines
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected][ 64.638596][ T203] ====================================================== [ 64.643742][ T203] WARNING: possible circular locking dependency detected [ 64.649127][ T203] 7.3.0-rc4+ #1 Not tainted [ 64.652392][ T203] ------------------------------------------------------This does not look like an actual deadlock. The
list_lrulock held byshmem_unused_huge_isolate()belongs to the shmem unused huge shrinklist, while the existing dependency was recorded for the dentry LRU. These are distinct lock instances.However, both locks use the default
list_lrulock class, so lockdep treats them as the same lock and combines their dependency chains.Could you please help test whether the following change makes the lockdep warning go away?
mm/shmem.c +2
-0@@ -5162,6 +5162,8 @@ static const struct dentry_operations shmem_ci_dentry_ops = { };#endif +static struct lock_class_key shmem_unused_huge_lock_key; +static int shmem_fill_super (struct super_block *sb,struct fs_context *fc) {struct shmem_options *ctx = fc->fs_private;
mm/shmem.c static int shmem_fill_super(struct super_block · line 5252
Quoted 9 lines
mm/shmem.c +2
-1@@ -5243,7 +5245,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
Applied the fix on top of commit b9b1861d4f. The issue cannot be reproduced.
Quoted 193 lines
Thanks,
QiQuoted 188 lines
[ 64.657842][ T203] systemd-udevd/203 is trying to acquire lock: [ 64.663589][ T203] f5835900 (&sb->s_type->i_lock_key){+.+.}-{3:3}, at: igrab+0x44/0xc0 [ 64.669221][ T203] [ 64.669221][ T203] but task is already holding lock: [ 64.669221][ T203] [ 64.669221][ T203] but task is already holding lock: [ 64.669221][ T203] [ 64.669221][ T203] but task is already holding lock: [ 64.674183][ T203] f5c5a61c (&l->lock){+.+.}-{3:3}, at: __list_lru_walk_one+0x55/0x180 [ 64.679737][ T203] [ 64.679737][ T203] which lock already depends on the new lock. [ 64.679737][ T203] [ 64.679737][ T203] which lock already depends on the new lock. [ 64.679737][ T203] [ 64.679737][ T203] which lock already depends on the new lock. [ 64.679737][ T203] [ 64.686427][ T203] [ 64.686427][ T203] the existing dependency chain (in reverse order) is: [ 64.686427][ T203] [ 64.686427][ T203] the existing dependency chain (in reverse order) is: [ 64.686427][ T203] [ 64.686427][ T203] the existing dependency chain (in reverse order) is: [ 64.691963][ T203] [ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}: [ 64.691963][ T203] [ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}: [ 64.691963][ T203] [ 64.691963][ T203] -> #2 (&l->lock){+.+.}-{3:3}: [ 64.695874][ T203] _raw_spin_lock+0x26/0x40 [ 64.699072][ T203] list_lru_add_obj+0x3c/0xc0 [ 64.702561][ T203] d_lru_add+0x40/0x80 [ 64.705640][ T203] fast_dput+0x1c7/0x200 [ 64.708794][ T203] dput+0x25/0x40 [ 64.711603][ T203] pick_link+0x1ed/0x340 [ 64.714612][ T203] step_into_slowpath+0x1af/0x200 [ 64.718143][ T203] path_lookupat+0x109/0x1c0 [ 64.721512][ T203] filename_lookup+0xc1/0x200 [ 64.725044][ T203] user_path_at+0x2f/0xc0 [ 64.728522][ T203] __ia32_sys_mount+0x134/0x1c0 [ 64.732025][ T203] ia32_sys_call+0x39/0x14c0 [ 64.735800][ T203] __do_fast_syscall_32+0x16c/0x340 [ 64.740069][ T203] do_fast_syscall_32+0x28/0x80 [ 64.743715][ T203] do_SYSENTER_32+0x12/0x40 [ 64.747337][ T203] entry_SYSENTER_32+0x98/0xfd [ 64.750971][ T203] [ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}: [ 64.750971][ T203] [ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}: [ 64.750971][ T203] [ 64.750971][ T203] -> #1 (&lockref->lock){+.+.}-{3:3}: [ 64.756528][ T203] _raw_spin_lock+0x26/0x40 [ 64.760072][ T203] d_instantiate+0x34/0x80 [ 64.763562][ T203] d_make_root+0x29/0x40 [ 64.766867][ T203] shmem_fill_super+0x292/0x340 [ 64.770617][ T203] get_tree_nodev+0x3e/0x80 [ 64.774112][ T203] shmem_get_tree+0x12/0x40 [ 64.777728][ T203] vfs_get_tree+0x1e/0xc0 [ 64.781170][ T203] vfs_kern_mount+0x6e/0xc0 [ 64.784747][ T203] kern_mount+0x16/0x40 [ 64.787998][ T203] shmem_init+0x26/0x100 [ 64.791525][ T203] mnt_init+0xfd/0x140 [ 64.794594][ T203] vfs_caches_init+0x26/0x40 [ 64.798341][ T203] start_kernel+0x2df/0x380 [ 64.801707][ T203] i386_start_kernel+0xc5/0x100 [ 64.805611][ T203] startup_32_smp+0x151/0x160 [ 64.809276][ T203] [ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}: [ 64.809276][ T203] [ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}: [ 64.809276][ T203] [ 64.809276][ T203] -> #0 (&sb->s_type->i_lock_key){+.+.}-{3:3}: [ 64.815036][ T203] __lock_acquire+0x1851/0x2a40 [ 64.818649][ T203] lock_acquire+0x96/0x200 [ 64.821879][ T203] _raw_spin_lock+0x26/0x40 [ 64.825139][ T203] igrab+0x44/0xc0 [ 64.828067][ T203] shmem_unused_huge_isolate+0x2e/0xc0 [ 64.832099][ T203] __list_lru_walk_one+0x98/0x180 [ 64.835960][ T203] list_lru_walk_node+0x1b/0x40 [ 64.839660][ T203] shmem_unused_huge_shrink+0x62/0x500 [ 64.843880][ T203] shmem_alloc_and_add_folio+0x1b8/0x480 [ 64.847901][ T203] shmem_get_folio_gfp+0x1af/0x880 [ 64.851755][ T203] shmem_write_begin+0x5c/0x100 [ 64.855571][ T203] generic_perform_write+0xc1/0x340 [ 64.859545][ T203] shmem_file_write_iter+0x5f/0x80 [ 64.863719][ T203] vfs_write+0x263/0x340 [ 64.867230][ T203] ksys_write+0x6a/0x100 [ 64.870798][ T203] __ia32_sys_write+0x18/0x40 [ 64.874740][ T203] ia32_sys_call+0x1365/0x14c0 [ 64.878135][ T203] __do_fast_syscall_32+0x16c/0x340 [ 64.881546][ T203] do_fast_syscall_32+0x28/0x80 [ 64.885606][ T203] do_SYSENTER_32+0x12/0x40 [ 64.889087][ T203] entry_SYSENTER_32+0x98/0xfd [ 64.892908][ T203] [ 64.892908][ T203] other info that might help us debug this: [ 64.892908][ T203] [ 64.892908][ T203] other info that might help us debug this: [ 64.892908][ T203] [ 64.892908][ T203] other info that might help us debug this: [ 64.892908][ T203] [ 64.900253][ T203] Chain exists of: [ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock [ 64.900253][ T203] [ 64.900253][ T203] Chain exists of: [ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock [ 64.900253][ T203] [ 64.900253][ T203] Chain exists of: [ 64.900253][ T203] &sb->s_type->i_lock_key --> &lockref->lock --> &l->lock [ 64.900253][ T203] [ 64.909551][ T203] Possible unsafe locking scenario: [ 64.909551][ T203] [ 64.909551][ T203] Possible unsafe locking scenario: [ 64.909551][ T203] [ 64.909551][ T203] Possible unsafe locking scenario: [ 64.909551][ T203] [ 64.915049][ T203] CPU0 CPU1 [ 64.918939][ T203] ---- ---- [ 64.922808][ T203] lock(&l->lock); [ 64.925634][ T203] lock(&lockref->lock); [ 64.930586][ T203] lock(&l->lock); [ 64.934913][ T203] lock(&sb->s_type->i_lock_key); [ 64.938686][ T203] [ 64.938686][ T203] *** DEADLOCK *** [ 64.938686][ T203] [ 64.938686][ T203] *** DEADLOCK *** [ 64.938686][ T203] [ 64.938686][ T203] *** DEADLOCK *** [ 64.938686][ T203] [ 64.944491][ T203] locks held by systemd-udevd/203: 4, last CPU#0: [ 64.949046][ T203] #0: f5c50a6c (sb_writers#6){.+.+}-{0:0}, at: vfs_write+0xb7/0x340 [ 64.954944][ T203] #1: f5655658 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: shmem_file_write_iter+0x28/0x80 [ 64.962274][ T203] #2: f5c5a61c (&l->lock){+.+.}-{3:3}, at: __list_lru_walk_one+0x55/0x180 [ 64.968148][ T203] #3: f5835810 (&info->lock){+.+.}-{3:3}, at: shmem_unused_huge_isolate+0x1f/0xc0 [ 64.974409][ T203] [ 64.974409][ T203] stack backtrace: [ 64.974409][ T203] [ 64.974409][ T203] stack backtrace: [ 64.974409][ T203] [ 64.974409][ T203] stack backtrace: [ 64.978786][ T203] CPU: 0 UID: 0 PID: 203 Comm: systemd-udevd Not tainted 7.3.0-rc4+ #1 PREEMPT 2f9698b0cc81084abb5f3c5754f76765d21e2bf0 [ 64.987668][ T203] Call Trace: [ 64.990012][ T203] __dump_stack+0x18/0x40 [ 64.993281][ T203] dump_stack_lvl+0x20/0x40 [ 64.996699][ T203] dump_stack+0xd/0x12 [ 64.999644][ T203] print_circular_bug+0x2bf/0x300 [ 65.003228][ T203] check_noncircular+0xd7/0x100 [ 65.006753][ T203] __lock_acquire+0x1851/0x2a40 [ 65.009733][ T203] ? _raw_spin_unlock_irqrestore+0x20/0x80 [ 65.013953][ T203] lock_acquire+0x96/0x200 [ 65.017236][ T203] ? igrab+0x44/0xc0 [ 65.020072][ T203] _raw_spin_lock+0x26/0x40 [ 65.023308][ T203] ? igrab+0x44/0xc0 [ 65.025972][ T203] igrab+0x44/0xc0 [ 65.028647][ T203] shmem_unused_huge_isolate+0x2e/0xc0 [ 65.032472][ T203] __list_lru_walk_one+0x98/0x180 [ 65.035619][ T203] ? shmem_unused_huge_shrink+0x500/0x500 [ 65.039875][ T203] list_lru_walk_node+0x1b/0x40 [ 65.043576][ T203] ? shmem_unused_huge_shrink+0x500/0x500 [ 65.047582][ T203] shmem_unused_huge_shrink+0x62/0x500 [ 65.051774][ T203] ? shmem_inode_acct_blocks+0x218/0x280 [ 65.055593][ T203] shmem_alloc_and_add_folio+0x1b8/0x480 [ 65.059093][ T203] shmem_get_folio_gfp+0x1af/0x880 [ 65.062996][ T203] shmem_write_begin+0x5c/0x100 [ 65.066769][ T203] generic_perform_write+0xc1/0x340 [ 65.070595][ T203] shmem_file_write_iter+0x5f/0x80 [ 65.074058][ T203] vfs_write+0x263/0x340 [ 65.077047][ T203] ? shmem_file_read_iter+0x400/0x400 [ 65.081058][ T203] ksys_write+0x6a/0x100 [ 65.084028][ T203] __ia32_sys_write+0x18/0x40 [ 65.087227][ T203] ia32_sys_call+0x1365/0x14c0 [ 65.090769][ T203] __do_fast_syscall_32+0x16c/0x340 [ 65.094701][ T203] ? do_fast_syscall_32+0x28/0x80 [ 65.098687][ T203] do_fast_syscall_32+0x28/0x80 [ 65.102284][ T203] do_SYSENTER_32+0x12/0x40 [ 65.105857][ T203] entry_SYSENTER_32+0x98/0xfd [ 65.109406][ T203] EIP: 0xa7fbbc4c [ 65.112302][ T203] Code: c0 74 05 c1 e9 0c 89 08 31 c0 5e 5d 31 c9 31 d2 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 8d 76 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 58 b8 [ 65.127608][ T203] EAX: ffffffda EBX: 00000010 ECX: 0238cb60 EDX: 00000023 [ 65.133201][ T203] ESI: 00000023 EDI: 0238cb60 EBP: 0238a5e0 ESP: afef94f0 [ 65.138647][ T203] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00200246The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20261009/[email protected]--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Andrew Morton
maintainerQuoted 8 lines · On Fri, 9 Oct 2026 15:58:46 +0800 "Qi Zheng" <[email protected]> wrote:
Could you please help test whether the following change makes the lockdep warning go away?
mm/shmem.c +0
-0
mm/shmem.c static const struct dentry_operations · line 5167
Quoted 6 lines
mm/shmem.c +2
-0@@ -5162,6 +5162,8 @@ static const struct dentry_operations shmem_ci_dentry_ops = { };#endif +static struct lock_class_key shmem_unused_huge_lock_key; +
This could be local to shmem_fill_super().
And inside #ifdef CONFIG_TRANSPARENT_HUGEPAGE somehow.
Quoted 5 lines
mm/shmem.c +0
-0static int shmem_fill_super (struct super_block *sb,struct fs_context *fc) {struct shmem_options *ctx = fc->fs_private;
mm/shmem.c static int shmem_fill_super(struct super_block · line 5252
Quoted 9 lines
mm/shmem.c +2
-1@@ -5243,7 +5245,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
Thanks, I'll await a formal (non-wordwrapped!) patch.
Hi Andrew,
Quoted 14 lines · Andrew Morton
Quoted 12 lines · On Fri, 9 Oct 2026 15:58:46 +0800 "Qi Zheng" <[email protected]> wrote:
Could you please help test whether the following change makes the lockdep warning go away?
mm/shmem.c +0
-0@@ -5162,6 +5162,8 @@ static const struct dentry_operations shmem_ci_dentry_ops = { };#endif
Quoted 6 lines
mm/shmem.c static const struct dentry_operations · line 5167
Quoted 2 lines
mm/shmem.c +2
-0+static struct lock_class_key shmem_unused_huge_lock_key; +This could be local to
shmem_fill_super().And inside #ifdef
CONFIG_TRANSPARENT_HUGEPAGEsomehow.
Got it. Will do.
Quoted 8 lines
Quoted 8 lines
mm/shmem.c +0
-0static int shmem_fill_super (struct super_block *sb,struct fs_context *fc) {struct shmem_options *ctx = fc->fs_private;mm/shmem.c +0
-0@@ -5243,7 +5245,8 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc) goto failed;
Quoted 9 lines
mm/shmem.c static int shmem_fill_super(struct super_block · line 5252
Quoted 7 lines
mm/shmem.c +2
-1#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 Thanks, I'll await a formal (non-wordwrapped!) patch.
OK, I'll send a formal fix patch soon.
Thanks,
Qi
PATCH 1/1 mm: shmem: assign a lock class to the unused huge shrinklist
In reply to Andrew MortonFrom: Qi Zheng <[email protected]>
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.
--- mm/shmem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
mm/shmem.c +5 -1
@@ -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
Signature · 1 line
2.54.0