From nobody Sat Jul 02 17:21:07 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 1119B87EF9E for ; Sat, 2 Jul 2022 17:21:08 +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 4LZzPH6MBjz3rZY for ; Sat, 2 Jul 2022 17:21:07 +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 BC1B6143E1 for ; Sat, 2 Jul 2022 17:21:07 +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 262HL7ke005253 for ; Sat, 2 Jul 2022 17:21:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 262HL7co005252 for bugs@FreeBSD.org; Sat, 2 Jul 2022 17:21:07 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 264867] kevent EVFILT_TIMER, timer expiration with twice the period Date: Sat, 02 Jul 2022 17:21:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markj@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: markj@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to Message-ID: In-Reply-To: References: 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=1656782467; 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: in-reply-to:in-reply-to:references:references; bh=Vjg8NmxR+Nes7HOL+s7acYMjX1rj+XeVUalQ1ChOjt0=; b=LqkL+KsRgC/LOBd2XdMblNoYwliZ2lRN4yr/o2v1l2BZSWp0qUlgeO31Bry7MjdOKoI6Xz I/grX9MjN48TT80AgPsRldQ/rS6ZO3wuDSiDAKdKa3KXw3tp8chlzUV5eJCKXjQDis7yv7 tgM6iI534NSMYtPuzqaL+AKhxIIwh2/8qmP1EtVd9MQ14i87Lbfpzpr/qNibbtkAITpyfe 79i3WeZnsjPSL4rZ8MsoSQtbgFwI4Jd5m1ltMLepK+W1+fpYgVY4IQcc5AeHum4cvgAAJT 1NT4mzxhjEXgyKLqQkexne0umArI07zkTiR0PTLO9najEeBEcWzoeMGwDpgV0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656782467; a=rsa-sha256; cv=none; b=RnggWoaNS/05ISdzP4RU4Vndxum2QlMyyu56HiYKiji85fF8PjQSfGhqb5zpDqG0A5XqRz Mu53ZtzeIB+FbVjM+CVsK7s584T9s0daUBVuH6pR8YoISGGXZ9YrwNlROaq7UbSQbTPh0E uTMYhhAr2PVBdX0W6rw/FAaPugXTIJ2net+gkmUtYwnhHa5P5sAP3GJOdtbF0azH2d5QdU e7Ol9nP+RHOM/klMgXEweb/ftRqOfwbb8GvXpHWXjHd5Vb6AxpVL6pHWLhA++Uk0OrYS7v s/JkVnCZDPRE6JTUsYly9Q5tGLhNlkzmUInv8+C0JDyfyi8VycbW88zp4TOz0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264867 Mark Johnston changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@FreeBSD.org |markj@FreeBSD.org --- Comment #16 from Mark Johnston --- Ok, I'm still able to reproduce the problem with my patch. But, the freque= ncy of the late wakeups is much much lower, and I'm fairly sure that the patch solves a legitimate problem on its own. Specifically, getnextcpuevent() contains the following bit of code: /* Handle callout events. */ if (event > state->nextcall) event =3D state->nextcall; It gets called when a CPU goes idle, and the idle thread is scheduling the = next timer interrupt. "nextcall" is not volatile, and interrupts are enabled, so state->nextcall can be modified between the check and the load, and the CPU will end up using a stale value. It might be that there is another, similar race in handleevents(), since a different CPU might be updating state->nextcall concurrently. But I think = the race is harmless since callout_process() should be able to find the next callout... --=20 You are receiving this mail because: You are the assignee for the bug.=