Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate decoupled timerfd logic in EpollEventLoop #9590

Closed
wants to merge 1 commit into from

Commits on Sep 23, 2019

  1. Reinstate decoupled timerfd logic in EpollEventLoop

    Motivation
    
    This reinstates the parts of 1fa7a5e
    and a22d4ba that were reverted in
    7f39142 (applies to EpollEventLoop
    class only), with some minor changes.
    
    It sounds like this still exhibits some testsuite failures even with the
    lazySet fixes, but I thought it would be good to have a PR with the
    "latest" version to continue to test/debug.
    
    Modification
    
    Changes are the same as before apart a few added comments and the
    following in EpollEventLoop#checkScheduleTaskQueueForNewDelay:
    - Use set instead of lazySet to avoid race condition
    - Avoid arming timer and entering epoll wait if a task has already
    expired
    - Switch order of calling setTimerFd and updating the nextDeadlineNanos
    AtomicLong within the sync block
    
    The latter two are perf refinements and should not have contributed to
    the issues seen.
    
    Result
    
    Performance benefits from having timerfd updates decoupled from the
    event loop, as originally introduced by @Scottmitch
    njhill committed Sep 23, 2019
    Configuration menu
    Copy the full SHA
    125dc27 View commit details
    Browse the repository at this point in the history