Re: The timerfd functions slow down emacs
- Date: Sat, 23 Feb 2019 16:05:03 +0000
- From: Ken Brown <kbrown@xxxxxxxxxxx>
- Subject: Re: The timerfd functions slow down emacs
On 2/21/2019 6:52 PM, Ken Brown wrote:
> When emacs is built, it detects the timerfd functions and uses them if they're
> found. Now that Cygwin has these functions, the resulting build of emacs is
> very slow to respond to user input. If I press a key, there is a 1-2 second
> delay before emacs responds.
> I can work around this by configuring emacs with emacs_cv_have_timerfd=no, but
> it would be nice to find the cause. I'll try to make an STC, but I thought I'd
> report it here in the meantime, in case anyone has ideas or debugging suggestions.
I don't have an STC yet, but if I start emacs and then attach gdb to it at
random times, the backtrace always look like this:
#0 0x00007ffbb192b4f4 in ntdll!ZwWaitForMultipleObjects ()
#1 0x00007ffbadf56099 in WaitForMultipleObjectsEx ()
#2 0x00007ffbadf55f8e in WaitForMultipleObjects ()
#3 0x0000000180159f9d in timerfd_tracker::wait (this=this@entry=0x1803a22c0,
#4 0x00000001800a7b0e in fhandler_timerfd::read (this=<optimized out>,
ptr=0xffffba30, len=@0xffffb9b0: 8)
This suggests to me that the slowdown comes from timerfd_tracker::wait.
The context is that emacs creates a timerfd timer that expires every 2 seconds,
'select' waits for the timer's file descriptor to be ready for reading, and then
emacs calls 'read'.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple