Technical Root Cause Analysis
The reported soft lockup (BUG: soft lockup - CPU#1 stuck for 31s! [syz.4.1340:9930]) is a false positive caused by host hypervisor vCPU preemption/starvation on GCE ARM64, combined with ARM64 lacking a kvm_check_and_clear_guest_paused() implementation. There is no deadlock, spinlock contention, or non-preemptible loop in overlayfs, splice, ext4, dquot, or kfence.
1. Why the filesystem/quota call chain on CPU 1 is not stuck
- Preemption is enabled and intact: The kernel is built with
CONFIG_PREEMPT=y and CONFIG_DEBUG_ATOMIC_SLEEP=y, and the task has no prior warning taint (Tainted: G L).
- Preemptible copy-up and allocation path:
ovl_copy_up_file() (fs/overlayfs/copy_up.c) splices in 1 MB chunks (OVL_COPY_UP_CHUNK_SIZE) via do_splice_direct() -> iter_file_splice_write() (fs/splice.c) -> ext4_buffered_write_iter() -> generic_perform_write() (mm/filemap.c). generic_perform_write() calls cond_resched() on every folio (mm/filemap.c:4435), and ext4_mb_new_blocks() calls might_sleep() (fs/ext4/mballoc.c:6240), confirming preempt_count() == 0 upon entry.
- Single-block allocation request:
ext4_block_write_begin() (fs/ext4/inode.c:1329-1332) invokes _ext4_get_block() with bh->b_size == blocksize, so map.m_len == 1 and ar.len == 1 in ext4_mb_new_blocks(), ruling out a long dquot_alloc_block() loop at fs/ext4/mballoc.c:6274-6280.
- Not spinning on
inode->i_lock: In __dquot_alloc_space() (fs/quota/dquot.c:1678), spin_lock(&inode->i_lock) was still inside lock_acquire() (kernel/locking/lockdep.c:5946) before do_raw_spin_lock() was reached.
- Not 31 seconds of active CPU execution:
irq event stamp: 483 indicates current->irqtrace.irq_events recorded fewer than ~240 IRQ disable/enable transitions in totalβfar too few for 31 seconds of active HZ timer ticks or continuous folio allocations. Furthermore, with CONFIG_PREEMPT=y, migration/1 runs in stop_sched_class and would immediately preempt syz.4.1340 to run softlockup_fn() on earlier watchdog ticks if CPU 1 were actively executing preemptible code.
2. Mechanism of the false-positive soft lockup and CPU 0's IPI wait
- IRQ masking during
lock_acquire(): On CPU 1, lock_acquire() (kernel/locking/lockdep.c:5938-5946) masked hardware interrupts via raw_local_irq_save(flags) while running __lock_acquire().
- Hypervisor vCPU stall: While CPU 1 had
PSTATE.I masked inside lock_acquire(), the GCE host hypervisor preempted/stalled vCPU 1 for ~31 seconds, during which the ARM64 architectural counter (cntvct_el0) continued advancing.
- Concurrent KFENCE IPI on CPU 0: Every
kfence_sample_interval, CPU 0 executes toggle_allocation_gate() (mm/kfence/core.c:894-909), calling static_branch_disable(&kfence_allocation_key) -> arch_jump_label_transform_apply() (arch/arm64/kernel/jump_label.c:34) -> kick_all_cpus_sync() -> smp_call_function_many_cond(). Because vCPU 1 was stalled (and then in watchdog_timer_fn() with IRQs disabled), CPU 0 waited in csd_lock_wait() (kernel/smp.c:389) for CPU 1 to acknowledge the IPI, where the NMI backtrace caught it.
- Immediate watchdog trigger without guest-pause accounting: As soon as vCPU 1 resumed and restored
DAIF in __daif_local_irq_restore() (arch/arm64/include/asm/irqflags.h:175, at lock_acquire+0x168), the pending arch timer interrupt fired watchdog_timer_fn() (kernel/watchdog.c:798). At kernel/watchdog.c:841, watchdog_timer_fn() calls kvm_check_and_clear_guest_paused() specifically to avoid false soft lockups after host-induced pauses, but on arm64 this resolves to the stub in include/asm-generic/kvm_para.h:12-15 that unconditionally returns false. Consequently, is_softlockup() (kernel/watchdog.c:868) sees the ~31s wall-clock jump exceeding get_softlockup_thresh() and immediately reports BUG: soft lockup before returning from the interrupt to let migration/1 execute softlockup_fn().