[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2018-06-08 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

David Bright  changed:

   What|Removed |Added

   Assignee|b...@freebsd.org|d...@freebsd.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2018-06-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #11 from Conrad Meyer  ---
(In reply to David Bright from comment #10)
Nope, I don't have any interest in it.  Please, go ahead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2018-06-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #10 from David Bright  ---
Conrad, do you want to take your patch forward? If not, I'd be interested in
taking on this bug.

(In reply to Conrad Meyer from comment #8)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-04-23 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

Jan Beich  changed:

   What|Removed |Added

 Attachment #177580|text/x-csrc |text/plain
  mime type||

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #9 from Conrad Meyer  ---
Created attachment 178773
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=178773=edit
Simple dtrace script for tracing timer filter calls

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #8 from Conrad Meyer  ---
Created attachment 178772
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=178772=edit
patch to update timer kevents

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #7 from Conrad Meyer  ---
I have a patch to modify existing timers:

$ ./test
kevent time: 1017

It is probably racy.  f_event calls should be protected by the knote list lock,
but nothing protects the first timer callout racing with the 2nd registration's
polling.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #6 from Conrad Meyer  ---
(In reply to Conrad Meyer from comment #5)

Well, ok, things like the user-supplied udata, fflags, and data are updated. 
Hmmm.  We could hook f_touch or just handle it in f_event.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #5 from Conrad Meyer  ---
In fact:

 EV_ADD   Adds the event to the kqueue.  Re-adding an existing event
 ^^^
  will modify the parameters of the original event, and not
  result in a duplicate entry.
  ^^

As far as I can tell, this isn't actually true.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #4 from Conrad Meyer  ---
It appears that fd-based filters will have the same behavior -- duplicate adds
(same ident and filter) are just ignored.  Given that, perhaps this is just a
documentation bug?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #3 from Conrad Meyer  ---
I see.  You are reusing the timer with ident=1.  Hm.  With:

@@ -25,7 +25,7 @@
 int n = ::kevent(kq, , 1, nullptr, 0, nullptr);
 assert(n == 0);

-EV_SET(, 1, EVFILT_TIMER, flags, fflags, 1000, nullptr);
+EV_SET(, 2, EVFILT_TIMER, flags, fflags, 1000, nullptr);
 n = ::kevent(kq, , 1, nullptr, 0, nullptr);
 assert(n == 0);

Two timers are attached, and the program indeed wakes up quickly:

CPU IDFUNCTION:NAME
  1  64686 kevent:entry 2017 Jan 11 20:06:00.530
  1  15060   filt_timerattach:entry 2017 Jan 11 20:06:00.530   
kn:f800286c4e00
  1  15061  filt_timerattach:return 2017 Jan 11 20:06:00.530   
kn:f800286c4e00 kc:f80005cb4200
  1  15061  filt_timerattach:return 2017 Jan 11 20:06:00.530   
return:0
  1  15058 filt_timer:entry 2017 Jan 11 20:06:00.530   
kn:f800286c4e00 hint:0
  1  15059filt_timer:return 2017 Jan 11 20:06:00.530   
return:0
  1  64686 kevent:entry 2017 Jan 11 20:06:00.530
  1  15060   filt_timerattach:entry 2017 Jan 11 20:06:00.530   
kn:f800286c4e80
  1  15061  filt_timerattach:return 2017 Jan 11 20:06:00.530   
kn:f800286c4e80 kc:f80005cb4180
  1  15061  filt_timerattach:return 2017 Jan 11 20:06:00.530   
return:0
  1  15058 filt_timer:entry 2017 Jan 11 20:06:00.530   
kn:f800286c4e80 hint:0
  1  15059filt_timer:return 2017 Jan 11 20:06:00.530   
return:0
  1  64686 kevent:entry 2017 Jan 11 20:06:00.530
  1  15064   filt_timerexpire:entry 2017 Jan 11 20:06:00.531   
kn:f800286c4e80
  1  15065  filt_timerexpire:return 2017 Jan 11 20:06:00.531   
return:f80004224a00
  3  15062   filt_timerdetach:entry 2017 Jan 11 20:06:00.531   
kn:f800286c4e80
  3  15063  filt_timerdetach:return 2017 Jan 11 20:06:00.531   
return:2
  3  15062   filt_timerdetach:entry 2017 Jan 11 20:06:00.532   
kn:f800286c4e00
  3  15063  filt_timerdetach:return 2017 Jan 11 20:06:00.532   
return:1

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

--- Comment #2 from Conrad Meyer  ---
Just kidding.  filt_timerattach() is only invoked once.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2017-01-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

Conrad Meyer  changed:

   What|Removed |Added

 CC||c...@freebsd.org

--- Comment #1 from Conrad Meyer  ---
Empirical observation:  Despite EV_ADD being used for both kevents in your
sample code, the same knote is reused.  Despite filt_timerattach() being called
twice without error, the shorter callout doesn't wake the note.  Digging
more...

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 214987] updating EVFILT_TIMER kqueue events doesn't work

2016-12-01 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214987

Bug ID: 214987
   Summary: updating EVFILT_TIMER kqueue events doesn't work
   Product: Base System
   Version: 11.0-RELEASE
  Hardware: Any
OS: Any
Status: New
  Severity: Affects Only Me
  Priority: ---
 Component: kern
  Assignee: freebsd-bugs@FreeBSD.org
  Reporter: bwell...@xbill.org

Created attachment 177580
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=177580=edit
test case

When a kqueue timer is created and updated (before the original timer fires),
the update has no effect.  See the attached sample program, which sets a
oneshot timer for 1s in the future, then changes the period to 1ms, then waits.
 The final kevent call waits for (approximately) 1s, which would happen if the
update doesn't take effect.

freebsd-11-x86-64-0:/u0/home/bwelling: ./timer
kevent time: 1000124

On macOS Sierra, for comparison:
wavelet:~: ./timer 
kevent time: 1217

It's possible that reusing timers is not allowed, but I can't find anything in
the documentation that indicates that.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"