[Bug 264867] kevent EVFILT_TIMER, timer expiration with twice the period

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 29 Jun 2022 21:14:03 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264867

--- Comment #6 from Mark Johnston <markj@FreeBSD.org> ---
To expand on my question a bit, I think there is a race somewhere in the
eventtimer code which occurs when a callout is scheduled on a different CPU. 
In particular, when an EVFILT_TIMER event is created, it is "pinned" to the
current CPU, and all future callouts will fire on the CPU.  I am not sure why
kevent does this, it doesn't make much sense to me.

If I change filt_timertouch() to set kc->cpuid = PCPU_GET(cpuid) each time the
event is re-added, then the bug is much harder to trigger.  Alternately, if the
test is changed so that each thread pins itself to a different CPU, then the
problem is not reproducible for me.

(In reply to felice.tufo from comment #4)
Does your test module specify the target CPU when arming a callout?

-- 
You are receiving this mail because:
You are the assignee for the bug.