From nobody Tue Mar 01 13:59:11 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 E83B819F2A28 for ; Tue, 1 Mar 2022 13:59:11 +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 4K7Jl33Tp7z4slt for ; Tue, 1 Mar 2022 13:59:11 +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 55AEA10D33 for ; Tue, 1 Mar 2022 13:59:11 +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 221DxB3A082001 for ; Tue, 1 Mar 2022 13:59:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 221DxB79082000 for bugs@FreeBSD.org; Tue, 1 Mar 2022 13:59:11 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 262273] Subsuquent Calls to clock_gettime(CLOCK_THREAD_CPUTIME_ID,... ) return time in the past Date: Tue, 01 Mar 2022 13:59:11 +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: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: donaldsharp72@gmail.com 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 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=1646143151; 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=TQlA76HKuo+6lG5m9s2uoxXmTzIUosz+Iy+uXnyxJ38=; b=XkIeOXOxY9mig8cjLEaDG0h2fEf92Ifk+4pHveu9JHI1YVz4498dW+dUUh9Ngml02mkrcX iBXSE16QVT4u7G1tAPECTeNxN9e9qs1Q0KmW6/PUC4kUP1Fj+J5EuLYUKcXfas/BmQatjn 2TMrMRZ1e9OnrMTtfXG3a3yf+2IB0n/hyj3OdX3OpRpR2LPy9Fai03w1K5+OCB3mMH+jo5 BbjFnQtKXXAMfy+1iPJB0V/hQAls5b24moDoXSKUYYLPlYrjKXRS0O6J2V9P77Tkw8DAnQ hZc0mZzAEpvEq3mJU5LGibun6cqNGtnHvqYgbFXIFQhqyDl4xi/uvSMLN5y9Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646143151; a=rsa-sha256; cv=none; b=YiAmI653tQBuE2TYOMfHElRtdVHr+QMcxY0GfdSC0Rd+JrjGZ4imr9KFV63p8Y8uumtwD1 sKwjC59G+V7aGpGradYB6S1n4Dpnb+prCll8WROMalfOSKEaBGmTCczIHlT4UG6wJJPEWI xb7/Wunic/LtuUbkpQjbjj+U3i0mEtX4IDvGxuwwwjG88KSBzR2BMo0dubvXLuBCzVwIpw m/jE5WUjinMKZjnsA1R5/wFub0ZgtHeR/v74gHzhsl7MEi78rMk/wJ19RzKBJLln6HI0dX ga1fJ0ekidUB8DP8WNk+3gRf5Z7pFrCmuuMOwJMs/zbWWKpoyCbKJMeBZ70y5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262273 Bug ID: 262273 Summary: Subsuquent Calls to clock_gettime(CLOCK_THREAD_CPUTIME_ID,... ) return time in the past Product: Base System Version: Unspecified Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: donaldsharp72@gmail.com When I run: ``` #include #include void main(void) { struct timespec before, after; while (1) { clock_gettime(CLOCK_THREAD_CPUTIME_ID, &before); clock_gettime(CLOCK_THREAD_CPUTIME_ID, &after); printf("before: %lu:%lu after %lu:%lu\n", before.tv_sec, before.tv_nsec, after.tv_sec, after.tv_nsec); if (after.tv_nsec < before.tv_nsec) exit(-1); } } ``` I get this output: before: 0:18195000 after 0:18198000 before: 0:26005000 after 0:18258000 The after time is prior to the before time. I am running on 12.1-Release in a vm on a ryzen 3900x. I also asked a frie= nd to run it on bare metal and got the same issue: before: 0:444288000 after 0:444288000 before: 0:446097000 after 0:444290000 They are running on FreeBSD 12.3-STABLE stable/12-n163-259bedb8f It is my expectation that there should not be jumps backwards in time. Is = my assumption incorrect? --=20 You are receiving this mail because: You are the assignee for the bug.=