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:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=NpUvjPgZj+UoBkN1jiTSVkdhbf4HSZrUg/AGi71WPxlZUF1avkLBo OCCdB3SHgBfMSHjziU34tSHI/7AXy0lRYtXwypjtFRkyuBFnFBNd5gVm08s/+yuh rtrbUd/NqXGV2mRjYosV2eJVb7UjN12XoYxe1oMtCvQ7Xu7TyYNVqY= 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:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=b57PQF2q393B/Tqr/Mr5t7bIr58=; b=bG6u0Sr10mYWAL3nFXpABbsfc5Jr D7g8OyB+mgJOqsENGiJaYnL/7GBUpFRtjojRanyQNv/FZWIeRlWIc9CbHX3sxmJr Cv0JWe/GEirziQiRHRBgt0XigGHmwwbsF/nc11ILR4zjAC5BkaR0fE/RaJ/O7CQ/ xY/cCDkrxTBjSdM= 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=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=10001, clock, clocks, timer X-HELO: mout.kundenserver.de Date: Sat, 23 Feb 2019 22:01:52 +0100 From: Corinna Vinschen To: Ken Brown Cc: "cygwin AT cygwin DOT com" Subject: Re: The timerfd functions slow down emacs Message-ID: <20190223210152.GA4133@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: Ken Brown , "cygwin AT cygwin DOT com" References: <04048cc3-091a-b55c-372b-bde29273d952 AT cornell DOT edu> <1df3d7ce-1427-cbd4-0978-7236b1903440 AT cornell DOT edu> <20190223191542 DOT GS4256 AT calimero DOT vinschen DOT de> <0f2789ab-5722-c0de-6176-d4e1aaff9f81 AT cornell DOT edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="r5Pyd7+fXNt84Ff3" Content-Disposition: inline In-Reply-To: <0f2789ab-5722-c0de-6176-d4e1aaff9f81@cornell.edu> User-Agent: Mutt/1.11.3 (2019-02-01) --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Feb 23 20:48, Ken Brown wrote: > On 2/23/2019 2:15 PM, Corinna Vinschen wrote: > > Below's the NSSTC I used to test my timerfd implementation (based on > > another STC to show a problem in POSIX timers). From what I can tell it > > works as desired. If you find a problem, please point it out or send a > > patch. >=20 > Thanks, that saved me a lot of time. I was in the process of creating a = test=20 > case when your mail arrived. >=20 > Your test works fine. For example: >=20 > $ gcc timerfd_test.c -o timerfd_test >=20 > $ ./timerfd_test.exe 3 1 10 > 0.000: timer started 52379 > 2.988: 52379 read: 1; total=3D1 > 3.988: 52379 read: 1; total=3D2 > 4.989: 52379 read: 1; total=3D3 > 5.987: 52379 read: 1; total=3D4 > 7.001: 52379 read: 1; total=3D5 > 7.987: 52379 read: 1; total=3D6 > 9.001: 52379 read: 1; total=3D7 > 9.987: 52379 read: 1; total=3D8 > 10.987: 52379 read: 1; total=3D9 > 11.997: 52379 read: 1; total=3D10 >=20 > But if I change CLOCK_MONOTONIC by CLOCK_REALTIME in the call to timerfd_= create,=20 > then I get the following: Only in timerfd_create? Not in clock_gettime? If you don't do that, you're using a different clock with entirely different values for the starttime. Actually, this testcase started with CLOCK_REALTIME in both calls. If I revert to that, I get: )$ ./timerfd 3 1 10 0.000: timer started 644 3.001: 644 read: 1; total=3D1 4.001: 644 read: 1; total=3D2 5.017: 644 read: 1; total=3D3 6.001: 644 read: 1; total=3D4 7.001: 644 read: 1; total=3D5 8.009: 644 read: 1; total=3D6 9.002: 644 read: 1; total=3D7 10.001: 644 read: 1; total=3D8 11.010: 644 read: 1; total=3D9 12.017: 644 read: 1; total=3D10 I tested this STC with differnt clocks, but it's important to use the same cloack for clock_gettime and timerfd_create. Corinna >=20 > $ ./timerfd_test.exe 3 1 10 > 0.000: timer started 52385 > 0.006: 52385 read: 1550343072; total=3D1550343072 >=20 > In particular, 'select' returns immediately. In the case of emacs, BTW, = timerfd=20 > is called like this: >=20 > fd =3D timerfd_create (CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC); >=20 > Ken --=20 Corinna Vinschen Cygwin Maintainer --r5Pyd7+fXNt84Ff3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxxtMAACgkQ9TYGna5E T6C9yg/+KEsYIVGRp56hO5jQuI76GnqCcYeTP7X+a4Pq9JAMMQ6lupp6IXrf2U33 Rlk1CQO2/HFsv3iQDIh1xDhcRiKCv8G4XIquk5lYCoaITv/oMdQYJclMw6LL15SV zZqkYIRLWS539sUoP9sx7Kmo3P2BY5lRQQcGKDXnZf+hXr/Vu1giZnThkZG5H+aw xQCOVHeXXoI5CUmEE4BfAQUdlaVItkl96LDwzrytGwr2B/rtvuwssI89O5OAI7ux /SGL7G0UVz+UfTXcEwnXT9vCGVgDTYbdgQy0k1d37tM2E0HMIoOvLgi+MduI5ySQ RAbKeW4Afen6/1d3Yfkf6EFzHpZQ9z0hAv7bFPKJNsTwvWmuiCjqeFfQAHhSaPMQ y2iXpY3LYIfokMDsyB61/rxmR7rYAfaMWuiwlw5XOWL3WMrzLhvxwlQnkiEEpMFo GOZ0hAgQkILUrDjHPIzIv3YH+wR57PCOFFv9nVAQBUtjG8qmsqFwv2aBh+Z2A9Gm IWqDjeXsRi9G/kvpnM+sKI5ozkXEPDMpz9k0BobAQpYexoZrE/bg0s22W3oWhLN3 5zXoAGzvWmwH3GkIKuCruWaPEe1lAr9kLWwWt8Mz+cbBz0ZKH5yqYquhdcl8QBXi o0TUznmD6YpVeN9PpoMqA37HXjyK52NuXgx8JlplTtJuZjL0lfY= =Y6qu -----END PGP SIGNATURE----- --r5Pyd7+fXNt84Ff3--