From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5312 invoked by alias); 23 Feb 2019 22:11:50 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 5062 invoked by uid 89); 23 Feb 2019 22:11:49 -0000 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=timer X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.134) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 23 Feb 2019 22:11:48 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N0o3Z-1hBV0K3wfN-00woCy; Sat, 23 Feb 2019 23:11:42 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 46324A80959; Sat, 23 Feb 2019 23:11:41 +0100 (CET) Date: Sat, 23 Feb 2019 22:52:00 -0000 From: Corinna Vinschen To: Ken Brown Cc: "cygwin@cygwin.com" Subject: Re: The timerfd functions slow down emacs Message-ID: <20190223221141.GB4133@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: Ken Brown , "cygwin@cygwin.com" References: <04048cc3-091a-b55c-372b-bde29273d952@cornell.edu> <1df3d7ce-1427-cbd4-0978-7236b1903440@cornell.edu> <20190223191542.GS4256@calimero.vinschen.de> <0f2789ab-5722-c0de-6176-d4e1aaff9f81@cornell.edu> <20190223210152.GA4133@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="A6N2fC+uXW/VQSAv" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-SW-Source: 2019-02/txt/msg00391.txt.bz2 --A6N2fC+uXW/VQSAv Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2509 On Feb 23 21:24, Ken Brown wrote: > On 2/23/2019 4:01 PM, Corinna Vinschen wrote: > > 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. > >> > >> Thanks, that saved me a lot of time. I was in the process of creating= a test > >> case when your mail arrived. > >> > >> Your test works fine. For example: > >> > >> $ gcc timerfd_test.c -o timerfd_test > >> > >> $ ./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 > >> > >> But if I change CLOCK_MONOTONIC by CLOCK_REALTIME in the call to timer= fd_create, > >> then I get the following: > >=20 > > 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. > >=20 > > Actually, this testcase started with CLOCK_REALTIME in both calls. > > If I revert to that, I get: > >=20 > > )$ ./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 > >=20 > > I tested this STC with differnt clocks, but it's important to > > use the same cloack for clock_gettime and timerfd_create. >=20 > Yes, that was careless of me. I now get the same results as you. I'll h= ave to=20 > go back to the emacs sources and see what else might be different there. You're right, nevertheless. Select on timerfd returns immediately. I (hope I) fixed that in git and uploaded new developer snapshots to https://cygwin.com/snapshots/ Please try especially with emacs. If that works as desired, I release 3.0.2 pretty soon. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer --A6N2fC+uXW/VQSAv Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxxxR0ACgkQ9TYGna5E T6Cm7w/7BIOv20GsshOHNskQW33leC88RRkPpt6M3fNv65QSFzLuCBlHdhfMwJPg FfB/xcxa+W/NXh+Yd3JLGZvNFbhCSCbMRG9m6zDXpZtovzGAYRTV4pGcgbwLbDAe gOENxD6oOLzMTBRYdH7D9rO4aey7E6G55qy1cehQ4uEC/YfRnH4mzmuQEcMXiqz4 FOJ7TSyYitb/z/7V8eTmzAmq7/uXID74G+uJ9kczTNOet4HffNHRLJzJz7GmQISP NmfOHsgLn1QhqIApwMx07ZcZ24bedAvtFIxdzOYhK2AIw2Yvv+pM4uO7faZ7io60 HURVBgNz9GFr6vJk+FYZKzz4drGQAGqt3Qu0JhmVHe4seFQ70gwNJjfFZuQ2Sump DcGXMhofIL3wW4uFZGlsGU7sTHDlXN9sdEczBpPOdfypoAUQUrJmm7+on7PE6sEP aYOxmjs/iWY5EIUvO7OIM7blLySErxiTgxcMgMoEMPCA3/gCE8e91YZ7ZIq6Zem5 Yu1QDoaDxtuLU5P71FgwTJv77Os4Sy7iwC5rtxNq5Hi9SCQ2nQOKlwlkL+TprNCx PD2amKuW2sA+FXoERqIcpznpf3OgftqQKMfdzFUjcA20wGMqaMwA6Jzn0F8hW6wZ tpfiRvxQFq/dGz0pYLAafE+qEYtLPykAmIR9mON/MbDGVHirZoo= =FauL -----END PGP SIGNATURE----- --A6N2fC+uXW/VQSAv--