Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102099292
D30069.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
795 B
Referenced Files
None
Subscribers
None
D30069.diff
View Options
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -718,6 +718,7 @@
{
struct kq_timer_cb_data *kc;
struct proc *p;
+ uint64_t delta;
sbintime_t now;
kc = kn->kn_ptr.p_v;
@@ -728,9 +729,17 @@
return;
}
- for (now = sbinuptime(); kc->next <= now; kc->next += kc->to)
- kn->kn_data++;
- KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */
+ now = sbinuptime();
+ if (now >= kc->next) {
+ delta = (now - kc->next) / kc->to;
+ if (delta == 0)
+ delta = 1;
+ kn->kn_data += delta;
+ kc->next += (delta + 1) * kc->to;
+ if (now >= kc->next) /* overflow */
+ kc->next = now + kc->to;
+ KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */
+ }
/*
* Initial check for stopped kc->p is racy. It is fine to
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 2:42 PM (22 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14536846
Default Alt Text
D30069.diff (795 B)
Attached To
Mode
D30069: filt_timerexpire: do not iterate over the interval
Attached
Detach File
Event Timeline
Log In to Comment