From nobody Sat May 21 19:21:41 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 20BB71B49061 for ; Sat, 21 May 2022 19:21:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L5D3n5YStz52WV for ; Sat, 21 May 2022 19:21:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D7274C13 for ; Sat, 21 May 2022 19:21:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 24LJLfIV066146 for ; Sat, 21 May 2022 19:21:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24LJLfAx066145 for bugs@FreeBSD.org; Sat, 21 May 2022 19:21:41 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 264131] 2nd and subsequent events on a repeating EVFILT_TIMER are delivered with twice the requested timer period Date: Sat, 21 May 2022 19:21:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: conorh@conorh.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653160901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QypQNhD3Z49osyJylVzsWZpAqpRzqY5HOZajogq1CE8=; b=vGiusOr8s8qK6ff6kmDjHootZeDN/y0/l7n5HDZHSOqLIxWEj8w9XgOhWmMsHZbaJ3w4rD lNYNpYJMbx1NdZHwafewKtI8i732qvasvcC/slFuc8IjVvtJs3qtn/97sGtVodbCG9BSEG YAiksYSEQiirHrgyZahZHsaYhYX0H7ks7C056LEyk1xx/2I3UFcRjQzSdzGRuZYFeNfYc3 5nycwd78YBIXzhTrke24p/TXGniuzAnb+4bH9Ppr+qu4VlxT5LwgA6Y+qMXm1GAbXWp1Ll S77PBbCOCFIS24XN1pVio/clEb8Cuh1qMl7v6vj9ymAPVWZ5mVpxODKupqb0ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653160901; a=rsa-sha256; cv=none; b=yzNkSgQwbY1KXtr0qe4gL9nMDDHBIaUFmw77PiEt1sSsPTW9BwpRV9fegKmz1KYYJeee2l 36xH9ZOvbiYMbum9vdzWBi61flNxtcRQfIQJa4k3w/cJK1iGCUHW7UtQ5vKQ2EnrMUzhnO H1H91nY+h8XgpW7OFAxLtavoovSYOQAhp6CM7MZSyaxcUcpCoHf6LaoJiItfKpEMnUBtXc ZnVDBVibDmn5QrxENNyDcMlhtD2FM07JdVR0K0gusCacXoWvPV8SY3uGhZdBf6i71rcKDG CEXbuWT0H0kW2BGS/FoxTOV3HP6DP5LTYa7CbWds+F/KHDSuU4oVUSn6YsqKGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264131 Bug ID: 264131 Summary: 2nd and subsequent events on a repeating EVFILT_TIMER are delivered with twice the requested timer period Product: Base System Version: 13.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: conorh@conorh.net Attachment #234088 text/plain mime type: Created attachment 234088 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D234088&action= =3Dedit reproducing test program As of FreeBSD 13.1, a repeating interval timer added to a kqueue (via EVFILT_TIMER, EV_ADD | EV_ENABLE) delivers the second and subsequent events with a period twice that of the requested timer period. The first event is delivered on-time. This appears to have been introduced in FreeBSD 13.1; 13= .0 and 12.3 (what I tested) don't exhibit the problem. Attaching a test program that creates such a timer for 500ms and waits for events one at a time forever, noting the calculated time interval between events. On 12.3 and 13.0, the program reports firing times reliably within a few ms of the requested 500ms: conorh@freebsd13dot0:~ $ ./repro_timer got event, ident 1, filter -7, data 1; last fire was 500 ms ago got event, ident 1, filter -7, data 1; last fire was 500 ms ago got event, ident 1, filter -7, data 1; last fire was 499 ms ago got event, ident 1, filter -7, data 1; last fire was 500 ms ago got event, ident 1, filter -7, data 1; last fire was 501 ms ago got event, ident 1, filter -7, data 1; last fire was 499 ms ago got event, ident 1, filter -7, data 1; last fire was 498 ms ago got event, ident 1, filter -7, data 1; last fire was 501 ms ago got event, ident 1, filter -7, data 1; last fire was 499 ms ago got event, ident 1, filter -7, data 1; last fire was 498 ms ago ^C conorh@freebsd13dot0:~ $ But on 13.1, it reports the first event around 500ms, and the second and subsequent ones around 1000ms: conorh@freebsd13dot1:~ $ ./repro_timer got event, ident 1, filter -7, data 1; last fire was 501 ms ago got event, ident 1, filter -7, data 1; last fire was 998 ms ago got event, ident 1, filter -7, data 1; last fire was 999 ms ago got event, ident 1, filter -7, data 1; last fire was 1000 ms ago got event, ident 1, filter -7, data 1; last fire was 999 ms ago got event, ident 1, filter -7, data 1; last fire was 1001 ms ago got event, ident 1, filter -7, data 1; last fire was 1000 ms ago got event, ident 1, filter -7, data 1; last fire was 1000 ms ago ^C conorh@freebsd13dot1:~ $ --=20 You are receiving this mail because: You are the assignee for the bug.=