You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scheduler hang: all tasks asleep after fork, CPU stuck in scheduler path
Symptom
Running lmbench (full suite or single test) in a QEMU+KVM guest, user-space fork-related operations hang: the serial goes silent, no output at all, all tasks fall asleep (gdb confirms CPU0 idle, CPU1 stuck in the scheduler), and QEMU keeps consuming CPU. The hang location is random — the ENOUGH-precompute fork, pipe-test fork, semaphore-test fork, and lat_fs fork all triggered it — with very high probability.
Reproduction (7/8 runs, same kernel 671b758 / clean vfat image)
Run
Scenario
Hang point
Behavior
R1
full e2e
ENOUGH precompute after init (timeout ... enough fork)
600s silent, 0 metrics
R2
full e2e
same
600s silent, 0 metrics
R3
full e2e
pipe_lat (lat_pipe benchmp fork)
3 samples all rc=124 (fork worker hung)
R4
--only ramfs
ENOUGH fork after init
20min silent, 0 metrics
R5
--only ramfs (ENOUGH preset)
lat_fs startup fork (inside run_with_timeout)
silent after RUN log, no sample-timeout logs
R6
pressure (init + bw_mem/...)
first pressure-test fork
6min silent; gdb: switch_finish_hook
R7
--only ramfs
ENOUGH fork
20min silent, 0 metrics
(Plus one gdb diagnostic run with an ENOUGH deadlock and one pipe_lat hang, not counted.)
CPU1 stuck in the scheduler __schedule_inner lock operation (SpinLockGuard lifetime), CPU0 idle. All user-space tasks asleep (the fork caller never returns).
CPU0 stuck in the process-switch finish hook switch_finish_hook; CPU1 waiting on a completion. Same scheduler subsystem, different function — the hang point drifts, the trigger (fork) is consistent.
Was misattributed to vfat corruption (power-loss damage on the old image amplified it to "always hangs"); after the vfat fix the issue exists independently (clean vfat, 7/8 runs)
Probability observation: the first run after an image rebuild can complete 17-32 metrics before hanging; later runs often hang on the first fork — some state-accumulation effect
Relation to tmpfs/lat_fs slowness
lat_fs run directly (fresh boot) is normal: 0k/1k/4k/10k all produce values (8724/8842/7727/8818 ops)
lat_fs run 3x consecutively (fresh boot) is normal: all 3 complete (2nd run shows 1k dropping 9128→3874 — early sign of state accumulation)
Conclusion: the tmpfs/lat_fs slowness is not an independent bug — it is the milder manifestation of the same kernel state-accumulation problem (fork hang is the severe one). Under stress (long runtime + heavy fork/memory/file activity) FS operations slow down first, then fork hangs. Because the fork-hang probability is very high (7/8 runs), the tmpfs slowness cannot be reproduced 3x independently.
Impact
The lmbench full suite cannot complete reliably (every run hangs at some fork point); any fork-dependent workload (shell scripts, test suites) is at risk. The vfat conclusion in #2167 needs correction: vfat corruption is an aggravating factor; this issue is the independent root cause.
Scheduler hang: all tasks asleep after fork, CPU stuck in scheduler path
Symptom
Running lmbench (full suite or single test) in a QEMU+KVM guest, user-space fork-related operations hang: the serial goes silent, no output at all, all tasks fall asleep (gdb confirms CPU0 idle, CPU1 stuck in the scheduler), and QEMU keeps consuming CPU. The hang location is random — the ENOUGH-precompute fork, pipe-test fork, semaphore-test fork, and lat_fs fork all triggered it — with very high probability.
Reproduction (7/8 runs, same kernel 671b758 / clean vfat image)
timeout ... enoughfork)(Plus one gdb diagnostic run with an ENOUGH deadlock and one pipe_lat hang, not counted.)
gdb snapshots (QEMU -gdb attach, while hung)
Snapshot 1 (R1/R2):
CPU1 stuck in the scheduler
__schedule_innerlock operation (SpinLockGuard lifetime), CPU0 idle. All user-space tasks asleep (the fork caller never returns).Snapshot 2 (R6):
CPU0 stuck in the process-switch finish hook
switch_finish_hook; CPU1 waiting on a completion. Same scheduler subsystem, different function — the hang point drifts, the trigger (fork) is consistent.Initial analysis
kernel/src/sched/(__schedule_inner, scheduler locks + SpinLockGuard);kernel/src/arch/x86_64/process/idle.rs:14-31(idle loop);ProcessManager::switch_finish_hookRelation to tmpfs/lat_fs slowness
Conclusion: the tmpfs/lat_fs slowness is not an independent bug — it is the milder manifestation of the same kernel state-accumulation problem (fork hang is the severe one). Under stress (long runtime + heavy fork/memory/file activity) FS operations slow down first, then fork hangs. Because the fork-hang probability is very high (7/8 runs), the tmpfs slowness cannot be reproduced 3x independently.
Impact
The lmbench full suite cannot complete reliably (every run hangs at some fork point); any fork-dependent workload (shell scripts, test suites) is at risk. The vfat conclusion in #2167 needs correction: vfat corruption is an aggravating factor; this issue is the independent root cause.
Environment