Closed g2p closed 2 months ago
I have a fix in the bcachefs-testing branch, can you test it?
I did finally boot bcachefs-testing (01c10bef726344d7793f82ac139b18fff000d92b), but still get a similar error immediately after mounting.
2024-08-07T10:40:29.095269+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): starting version 1.9: disk_accounting_v2 opts=compression=lz4,background_compression=zstd,foreground_target=ssd,background_target=hdd,promote_target=ssd,gc_reserve_percent=5,verbose
2024-08-07T10:40:29.095358+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): recovering from clean shutdown, journal seq 51484698
2024-08-07T10:40:29.175441+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): accounting_read... done
2024-08-07T10:40:31.015267+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): alloc_read... done
2024-08-07T10:40:31.015346+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): stripes_read... done
2024-08-07T10:40:31.015367+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): snapshots_read... done
2024-08-07T10:40:31.155799+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): journal_replay... done
2024-08-07T10:40:31.155861+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): resume_logged_ops... done
2024-08-07T10:40:31.155881+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): going read-write
2024-08-07T10:40:31.155900+00:00 moulinex kernel: bcachefs (9986b9d8-9f64-43c3-9a1d-cd397dcf3643): done starting filesystem
2024-08-07T10:40:31.172556+00:00 moulinex kernel:
2024-08-07T10:40:31.172599+00:00 moulinex kernel: =================================
2024-08-07T10:40:31.172614+00:00 moulinex kernel: WARNING: bad contention detected!
2024-08-07T10:40:31.172658+00:00 moulinex kernel: 6.11.0-rc2-g2p #40 Tainted: G E
2024-08-07T10:40:31.172672+00:00 moulinex kernel: ---------------------------------
2024-08-07T10:40:31.172685+00:00 moulinex kernel: kworker/9:3/11249 is trying to contend lock (&b->lock) at:
2024-08-07T10:40:31.172699+00:00 moulinex kernel: six_lock_ip_waiter (fs/bcachefs/six.c:558)
2024-08-07T10:40:31.172712+00:00 moulinex kernel: but there are no locks held!
2024-08-07T10:40:31.172733+00:00 moulinex kernel:
other info that might help us debug this:
2024-08-07T10:40:31.172747+00:00 moulinex kernel: 5 locks held by kworker/9:3/11249:
2024-08-07T10:40:31.172760+00:00 moulinex kernel: #0: ffff9fae845be558 ((wq_completion)bcachefs_write_ref){+.+.}-{0:0}, at: process_one_work (kernel/workqueue.c:3206 (discriminator 1))
2024-08-07T10:40:31.172773+00:00 moulinex kernel: #1: ffffab6fc2aafe40 ((work_completion)(&ca->discard_work)){+.+.}-{0:0}, at: process_one_work (kernel/workqueue.c:3207 (discriminator 1))
2024-08-07T10:40:31.172787+00:00 moulinex kernel: #2: ffff9faea08843e8 (&c->btree_trans_barrier){.+.+}-{0:0}, at: bch2_btree_path_traverse_one (./include/linux/srcu.h:151 (discriminator 1) ./include/linux/srcu.h:250 (discriminator 1) fs/bcachefs/btree_iter.c:3021 (discriminator 1) fs/bcachefs/btree_iter.c:1132 (discriminator 1))
2024-08-07T10:40:31.172800+00:00 moulinex kernel: #3: ffff9faea08a8888 (&c->gc_lock){.+.+}-{3:3}, at: bch2_btree_update_start (fs/bcachefs/btree_update_interior.c:1195 (discriminator 1))
2024-08-07T10:40:31.172813+00:00 moulinex kernel: #4: ffff9fae81de8128 (bcachefs_btree){+.+.}-{0:0}, at: __bch2_trans_relock (fs/bcachefs/btree_locking.h:194 (discriminator 1) fs/bcachefs/btree_locking.c:785 (discriminator 1))
2024-08-07T10:40:31.172826+00:00 moulinex kernel:
stack backtrace:
2024-08-07T10:40:31.172839+00:00 moulinex kernel: CPU: 9 UID: 0 PID: 11249 Comm: kworker/9:3 Tainted: G E 6.11.0-rc2-g2p #40
2024-08-07T10:40:31.172852+00:00 moulinex kernel: Tainted: [E]=UNSIGNED_MODULE
2024-08-07T10:40:31.172865+00:00 moulinex kernel: Hardware name: To Be Filled By O.E.M. X570 Phantom Gaming 4/X570 Phantom Gaming 4, BIOS P5.61 02/22/2024
2024-08-07T10:40:31.172885+00:00 moulinex kernel: Workqueue: bcachefs_write_ref bch2_do_discards_work
2024-08-07T10:40:31.172898+00:00 moulinex kernel: Call Trace:
2024-08-07T10:40:31.172912+00:00 moulinex kernel: <TASK>
2024-08-07T10:40:31.172924+00:00 moulinex kernel: dump_stack_lvl (lib/dump_stack.c:122)
2024-08-07T10:40:31.172937+00:00 moulinex kernel: dump_stack (lib/dump_stack.c:129)
2024-08-07T10:40:31.172951+00:00 moulinex kernel: print_lock_contention_bug (kernel/locking/lockdep.c:5920)
2024-08-07T10:40:31.172963+00:00 moulinex kernel: ? bch2_btree_node_alloc (fs/bcachefs/btree_locking.h:224 fs/bcachefs/btree_locking.h:250 fs/bcachefs/btree_update_interior.c:392)
2024-08-07T10:40:31.172976+00:00 moulinex kernel: lock_acquired (kernel/locking/lockdep.c:5987 kernel/locking/lockdep.c:6044)
2024-08-07T10:40:31.172990+00:00 moulinex kernel: ? bch2_btree_node_alloc (fs/bcachefs/btree_locking.h:224 fs/bcachefs/btree_locking.h:250 fs/bcachefs/btree_update_interior.c:392)
2024-08-07T10:40:31.173002+00:00 moulinex kernel: six_lock_ip_waiter (fs/bcachefs/six.c:558)
2024-08-07T10:40:31.173015+00:00 moulinex kernel: ? bch2_check_for_deadlock (fs/bcachefs/btree_locking.c:398)
2024-08-07T10:40:31.173039+00:00 moulinex kernel: bch2_btree_node_alloc (fs/bcachefs/btree_locking.h:252 (discriminator 1) fs/bcachefs/btree_update_interior.c:392 (discriminator 1))
2024-08-07T10:40:31.173052+00:00 moulinex kernel: ? bch2_btree_node_alloc (fs/bcachefs/btree_locking.h:224 fs/bcachefs/btree_locking.h:250 fs/bcachefs/btree_update_interior.c:392)
2024-08-07T10:40:31.173065+00:00 moulinex kernel: bch2_btree_node_alloc_replacement (fs/bcachefs/btree_update_interior.c:449)
2024-08-07T10:40:31.173078+00:00 moulinex kernel: ? srso_return_thunk (arch/x86/lib/retpoline.S:224)
2024-08-07T10:40:31.173091+00:00 moulinex kernel: ? mutex_unlock (kernel/locking/mutex.c:549)
2024-08-07T10:40:31.173103+00:00 moulinex kernel: ? srso_return_thunk (arch/x86/lib/retpoline.S:224)
2024-08-07T10:40:31.173116+00:00 moulinex kernel: ? bch2_btree_interior_update_will_free_node (fs/bcachefs/btree_update_interior.c:1108)
2024-08-07T10:40:31.173129+00:00 moulinex kernel: btree_split (fs/bcachefs/btree_update_interior.c:1662)
2024-08-07T10:40:31.173142+00:00 moulinex kernel: bch2_btree_split_leaf (fs/bcachefs/btree_update_interior.c:1858)
2024-08-07T10:40:31.173155+00:00 moulinex kernel: bch2_trans_commit_error (fs/bcachefs/btree_trans_commit.c:947)
2024-08-07T10:40:31.173168+00:00 moulinex kernel: ? bch2_discard_one_bucket (fs/bcachefs/alloc_background.c:1831)
2024-08-07T10:40:31.173188+00:00 moulinex kernel: ? srso_return_thunk (arch/x86/lib/retpoline.S:224)
2024-08-07T10:40:31.173200+00:00 moulinex kernel: ? bch2_trans_unlock_write (fs/bcachefs/six.h:367 (discriminator 1) fs/bcachefs/btree_locking.h:181 (discriminator 1) fs/bcachefs/btree_trans_commit.c:142 (discriminator 1))
2024-08-07T10:40:31.173213+00:00 moulinex kernel: ? bch2_trans_lock_write (fs/bcachefs/btree_trans_commit.c:101 fs/bcachefs/btree_trans_commit.c:129)
2024-08-07T10:40:31.173273+00:00 moulinex kernel: __bch2_trans_commit (fs/bcachefs/btree_trans_commit.c:1175 (discriminator 1))
2024-08-07T10:40:31.173290+00:00 moulinex kernel: bch2_discard_one_bucket (fs/bcachefs/alloc_background.c:1831)
2024-08-07T10:40:31.173306+00:00 moulinex kernel: ? srso_return_thunk (arch/x86/lib/retpoline.S:224)
2024-08-07T10:40:31.173322+00:00 moulinex kernel: ? bch2_discard_one_bucket (fs/bcachefs/alloc_background.c:1831)
2024-08-07T10:40:31.173338+00:00 moulinex kernel: bch2_do_discards_work (fs/bcachefs/alloc_background.c:1858 (discriminator 9))
2024-08-07T10:40:31.173355+00:00 moulinex kernel: process_one_work (kernel/workqueue.c:3236)
2024-08-07T10:40:31.173371+00:00 moulinex kernel: ? worker_thread (kernel/workqueue.c:3349)
2024-08-07T10:40:31.173388+00:00 moulinex kernel: worker_thread (kernel/workqueue.c:3306 (discriminator 2) kernel/workqueue.c:3390 (discriminator 2))
2024-08-07T10:40:31.173405+00:00 moulinex kernel: ? rescuer_thread (kernel/workqueue.c:3339)
2024-08-07T10:40:31.173422+00:00 moulinex kernel: kthread (kernel/kthread.c:389)
2024-08-07T10:40:31.173450+00:00 moulinex kernel: ? kthread_insert_work_sanity_check (kernel/kthread.c:342)
2024-08-07T10:40:31.173467+00:00 moulinex kernel: ret_from_fork (arch/x86/kernel/process.c:153)
2024-08-07T10:40:31.173484+00:00 moulinex kernel: ? kthread_insert_work_sanity_check (kernel/kthread.c:342)
2024-08-07T10:40:31.173501+00:00 moulinex kernel: ret_from_fork_asm (arch/x86/entry/entry_64.S:257)
2024-08-07T10:40:31.173518+00:00 moulinex kernel: </TASK>
Here are the relevant lockdep options I enabled in .config:
CONFIG_LOCK_DEBUGGING_SUPPORT=y
-# CONFIG_PROVE_LOCKING is not set
-# CONFIG_LOCK_STAT is not set
-# CONFIG_DEBUG_RT_MUTEXES is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
-# CONFIG_DEBUG_RWSEMS is not set
-# CONFIG_DEBUG_LOCK_ALLOC is not set
+CONFIG_PROVE_LOCKING=y
+# CONFIG_PROVE_RAW_LOCK_NESTING is not set
+CONFIG_LOCK_STAT=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
+CONFIG_DEBUG_RWSEMS=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_LOCKDEP=y
+CONFIG_LOCKDEP_BITS=15
+CONFIG_LOCKDEP_CHAINS_BITS=16
+CONFIG_LOCKDEP_STACK_TRACE_BITS=19
+CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
+CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
+# CONFIG_DEBUG_LOCKDEP is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
@@ -6631,2 +6639,3 @@ CONFIG_STACKTRACE=y
#
+CONFIG_PROVE_RCU=y
# CONFIG_RCU_SCALE_TEST is not set
@@ -6670,2 +6679,3 @@ CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_PREEMPTIRQ_TRACEPOINTS=y
ff9bf4b34104955017822e9bc42aeeb526ee2a80 fixes it! Thank you.
Not sure if this is really a problem, but since I have it here is the report:
This happens at mount time with e12b7d19c7b20536681e073c503e428fb3a8bfa0 (recent bcachefs-testing, has the lockdep stuff sent for 6.11) (plus recent stable fixes but I had the same report without).