X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; q=dns; s=default; b=qHtaTSdjDpGFOZjlW62BUVm5U1Pic 8+MaY3cneGFE+uausgIbdZ+3HWLye6CdeGmiSE4riJhcRis5WmqvMM5DUreobt2y 7H9zQxEW9HKYXl+QYp8BsiS2gwWUo3UuyFT5gnnYRXqfOnRj8skHQJgL2WaWoBKo gz/AFsM9FmsaCY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; s=default; bh=TurAOi1uawatZ3IZK4GFgmj6pcs=; b=ADs T8hlEHpU976imguGQtUJo2ENmvgD13MsL7K9TcXsyPxoMaP+ulYoHHX4Tp9XS/0J dNTrB5yqKwbub/Qb2gmSe/naI2tmwPZJaPkBa06vt6RFS0xdRQa9HAWdaou72ViJ W6exVqJ2R/AiIUjNkZwSfXdEc6lUtwi6xRBK0IrE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=timer, waits, Hx-languages-length:1609, respond X-HELO: NAM02-BL2-obe.outbound.protection.outlook.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WImcm0HmVnPTlSKQjr1UhUJZZIP5xoLy8T2wj/NXQpc=; b=KrLTzdEU5uWLriYGPyE88X+9BUBL4qXQq0hAzzeudidalzLwxVLEbwJaQjr594IIRWp2fKI104OJKWwLoQaIRE+mmeJcvwPJDB/1dqnQv+783NF3AmHYKf5RkAz14tKORqzqWaWqyk70fk6OxXu9+UDC3VhRo7kJiELi54Stk2I= From: Ken Brown To: "cygwin AT cygwin DOT com" Subject: Re: The timerfd functions slow down emacs Date: Sat, 23 Feb 2019 16:05:03 +0000 Message-ID: <1df3d7ce-1427-cbd4-0978-7236b1903440@cornell.edu> References: <04048cc3-091a-b55c-372b-bde29273d952 AT cornell DOT edu> In-Reply-To: <04048cc3-091a-b55c-372b-bde29273d952@cornell.edu> user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x1NG5j4w004526 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 () from /c/WINDOWS/SYSTEM32/ntdll.dll #1 0x00007ffbadf56099 in WaitForMultipleObjectsEx () from /c/WINDOWS/System32/KERNELBASE.dll'' #2 0x00007ffbadf55f8e in WaitForMultipleObjects () from /c/WINDOWS/System32/KERNELBASE.dll #3 0x0000000180159f9d in timerfd_tracker::wait (this=this AT entry=0x1803a22c0, nonblocking=false) at /usr/src/debug/cygwin-3.0.1-1/winsup/cygwin/timerfd.cc:448 #4 0x00000001800a7b0e in fhandler_timerfd::read (this=, ptr=0xffffba30, len=@0xffffb9b0: 8) at /usr/src/debug/cygwin-3.0.1-1/winsup/cygwin/fhandler_timerfd.cc:134 [...] 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'. Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple