From nobody Fri Apr 14 15:39:42 2023 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 4PygcH48nzz45TK2 for ; Fri, 14 Apr 2023 15:39:43 +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 4PygcH21rGz4RZV for ; Fri, 14 Apr 2023 15:39:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681486783; 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=CuB+6S/eRICcG6pya+/9LwxHsBVgvkvFo07uNZPFb54=; b=MwxdsD7tgM1Y6MMEoWEs6KNIlOsyaQ/9LPDSAitLMtTIXOO9w/voGuXGjcA1epkNQB1E92 5HZE0n+BrOjZnapg11DYoFRrpm1zYqrnWuAg44qmGJRnEX42gJnwivXrQcpq01O2YHf5Ar gq4I3nFttJX53H4tg6bSvxOcT+nRvneuusb7XtLjALeAMHZer4Or7xaIDo4KrC40HIDXsJ EBSNUwfRcp10yq8mPWSzfI8zTUf3MW0zh7ypb6xxqNO+ACd2goo0yiwqtI8rMUu/+WXphS f8InpgkeOp4GOOQoMKCcclOvyShCTmDwPZY8Ck4K+0tPxKRE5kQLHFjTS1f4DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681486783; a=rsa-sha256; cv=none; b=Df2QqnJvs0cMZpGcYWbhfnlCV4gPVSfHlmp1lxH/7Iq+eXJoB4/5PxBz1gd+vtlS9E9wSv aYx8iu7VvCtUR6v+UaR8NAk26YAF4zNwjeHrWaBr4C4mvo3UvodihstBcJA84fdu5cqjnW KJb3hLESc8TAPc16vzjM+d9/GqbIU2hIXJZ8CTNqj2D3q3KTZ/TwrYW3Kf4hmUM2E2/NtL uIAwTVaY0Rcsy5ZLq7ZLgQJZJ28rMVLi+wJQllfVuEnnBxwdxr8PI671y0rWnLAMPuqgTJ h/wtN5U6lrdqORBqW1QpWkrXN2yJu9EV20Ec8hUPEWZx0Qghxp58IAPg5xG5/w== 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 4PygcH16tnzVY2 for ; Fri, 14 Apr 2023 15:39:43 +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 33EFdhoO076003 for ; Fri, 14 Apr 2023 15:39:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 33EFdhv0076002 for bugs@FreeBSD.org; Fri, 14 Apr 2023 15:39:43 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 270785] Performance and power efficiency regression due to pthread_cond_timedwait() changes Date: Fri, 14 Apr 2023 15:39:42 +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.2-RELEASE X-Bugzilla-Keywords: performance, regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bllcha013@myuct.ac.za X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270785 --- Comment #6 from bllcha013@myuct.ac.za --- Interestingly, there is a bug report for Minecraft that seems related: https://bugs.mojang.com/browse/MC-183518 It seems that an extremely low timeout is causing massive numbers of calls = per second. This issue wasn't noticeable before, but now is, probably due to the increased precision of timing allowed with the commit. For Linux, changing = the value in /proc//timerslack_ns apparently helps, but it isn't there on FreeBSD. I noticed that the difference between "steps" of the tv_nsec value in the dtrace output was seemingly tied to kern.hz before the commit, so kern.hz= =3D100 would give a 10ms step, and kern.hz=3D1000 would give a 1ms step, no matter= what kern.eventtimer.periodic is set to, which I confirmed with dtrace. After the commit, kern.hz doesn't seem to have an impact when kern.eventtimer.periodi= c=3D0: the step is always 0.1ms. However, using kern.eventtimer.periodic=3D1 chang= es things: it becomes 0.5ms with kern.hz=3D1000 and 2.5ms with kern.hz=3D100. From my (limited) understanding, the commit improves the precision of timed waits, but the old behavior inadvertently helped with CPU utilization and p= ower efficiency by preventing software from being too abusive with short timeouts and constantly waking the CPU. Please let me know if there is any other information I can provide. --=20 You are receiving this mail because: You are the assignee for the bug.=