On Sun, 16 Jan 2011 18:24:59 +0200 Alexander Nezhinsky <alexandern@xxxxxxxxxxxx> wrote: > On 01/15/2011 01:14 PM, FUJITA Tomonori wrote: > >> Re-implementing the time-based work scheduler. This patch implements > >> a timer-based scheme. > > > You need this patch for more precise timer, right? In another way, the > > problem that you try to fix is that the current timer is too > > unexpected. > > Yes, the jiffies mechanism relied on the timeout values passed to > epoll_wait(), but the events could pop up before the timed has expired. > So under load, the intervals between jiffies counts are practically zero. > On the other hand, event handlers can take indefinite times, but this > would be undetected by the jiffies count. > > In the new scheme, the timer never "underflows" - at least the requested > interval is alwys guaranteed. Other event handlers can still delay > the actual work scheduling, but after they return all overdue work units > are submitted for execution immediately. > > The underlying timer fires every 250ms, setting the expected accuracy of > scheduling. I guess that all event handlers practically complete well > within this interval, so we can fairly count on delays bounded by, > let's say, ~300ms. Even if the timer fires every 250ms, there is no guarantee that the file descriptor is handled immediately, right? Adding the better timer is fine by me. Can we use timerfd instead of using another thread? timerfd is exactly what we want here. We still need to care about too old kernels that don't support timerfd? -- To unsubscribe from this list: send the line "unsubscribe stgt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html