Re: [PATCH] timers: Clear pending_map on CPU hotplug
From: Liang Hao
Date: Mon Aug 24 2026 - 11:53:24 EST
Hi,
Additional measurements on a local arm64 Android board.
Method (two sessions per build):
5 runs per session, 5 offline/online pairs per run.
Per pair:
taskset 0x8 sh -c 'n=0; while [ $n -lt 100 ]; do sleep 0.01; n=$((n+1)); done' &
sleep 0.5
echo 0 > /sys/devices/system/cpu/cpu3/online
echo 1 > /sys/devices/system/cpu/cpu3/online
wait
# then the same sleep loop again
Temporary debug dmesg counts per run:
empty_bucket - collect_expired_timers() saw pending_map bit set
with an empty hlist (next_expiry had been pulled to
a stale empty bucket after re-online)
stale_pending - timers_dead_cpu() saw non-empty pending_map after
migrate (same probe on both builds; Build A then
clears, Build B does not)
Build A: clear pending_map after migrate
Build B: do not clear
Build A session 1 / 2 (empty_bucket, stale_pending):
0,6 0,6 0,6 0,6 0,5
0,7 0,5 0,5 0,5 0,5
Build B session 1 / 2:
33,10 18,10 10,10 12,10 6,10
32,10 14,10 17,10 13,10 10,10
stale_pending > 0 on both builds is expected: migrate leaves bits set
while vectors are empty. Build A clears them; Build B leaves them.
The discriminator is empty_bucket: without clearing it is > 0 every
run; with clearing it stays 0.
Thanks,
Liang Hao