From nobody Sun Dec 19 14:48:29 2021 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 3012118F8B9D for ; Sun, 19 Dec 2021 14:48:30 +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 4JH5F96hrCz3BxR for ; Sun, 19 Dec 2021 14:48:29 +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 C6A9D24372 for ; Sun, 19 Dec 2021 14:48:29 +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 1BJEmTcc034248 for ; Sun, 19 Dec 2021 14:48:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1BJEmTir034247 for bugs@FreeBSD.org; Sun, 19 Dec 2021 14:48:29 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 254040] AMD 5950X hyperthreading strange performance swings Date: Sun, 19 Dec 2021 14:48:29 +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: 12.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: se@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=1639925310; 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=3HaKdqe4t6is9qPV8Fopz/hEB5MHEQ9Ymr5Xh0VL5sE=; b=twPASNt0PfGD76Ozeq6X0zmNbZhgVPYrl33DzXsshpJyldsWNoa7CxvEiOXWl8NAsP/KiA nqNIn5OROHw73bu7hdnMC6xOBUjy3CFGmjZWYGosT2IBtVww/DZxta2EFmLFrVHORD9ayy C97VDRz1DrCGZWnXEqb13rC4r5pBwR63QqK3b+nFOettO/x/WLwELQTaQau9PXbJXE+Tph shENsGMSuPquniYwJRnfMJeqj6GYLQjtzing0H2gdfV8pvF4k0P77xLn85Z6MSKnaEtNbR bBcgmPZ2NzZMQD2K3JhBiK4DdOTJeXh2LNZiGkJUjpUJAwOrk31no0t2ew+ZZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639925310; a=rsa-sha256; cv=none; b=KD1mg/2MRyglTK6Eelnfc5tCePJrg4b+awwjozSubfUNuEAbGkHOBLtfdntWPdyv3UT5ZW dLMpXan3GUnaK2UKE/W4bRceJn0XN8mdhRHtLtK7tuaRNf8eV7Agm36W/0CPDZeU8/MBYD PEb+Lw0EIgy5MqKXR4/Ace1JiCiyzCjTdAphlao7Ce+ooBqfJj1VJpW/0IIy8IusMuav3u agCIbENYuVjSZdZj4g0e4QZNSbsKnaKbqyj5KSKFCwTVHh2PrcKnJnMYq1Mja36hELT6j2 ErtJDCA1/5uRopad1VkLauQu8lLTCpj+PyY8Ntn3EUVFnGEOu2elIN8eByg1hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254040 Stefan E=C3=9Fer changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |se@FreeBSD.org --- Comment #2 from Stefan E=C3=9Fer --- Interesting result, which I could reproduce. But I'd be very surprised if this was connected to bug 256594. I have performed a few tests on -CURRENT, with different numbers of process= es running in parallel: $ t () {=20 for i in $(jot ${1:-1}); do dd if=3D/dev/zero bs=3D1M count=3D1000 | bzip2 - | wc > /dev/null & done 2>&1 | grep transferred; wait } $ t 4 1048576000 bytes transferred in 5.601800 secs (187185555 bytes/sec) 1048576000 bytes transferred in 5.649712 secs (185598117 bytes/sec) 1048576000 bytes transferred in 5.695707 secs (184099356 bytes/sec) 1048576000 bytes transferred in 9.145955 secs (114649153 bytes/sec) $ t 4 1048576000 bytes transferred in 5.615530 secs (186727884 bytes/sec) 1048576000 bytes transferred in 6.000599 secs (174745209 bytes/sec) 1048576000 bytes transferred in 8.281161 secs (126621862 bytes/sec) 1048576000 bytes transferred in 8.982560 secs (116734646 bytes/sec) $ t 4 1048576000 bytes transferred in 5.597056 secs (187344204 bytes/sec) 1048576000 bytes transferred in 8.940248 secs (117287131 bytes/sec) 1048576000 bytes transferred in 8.962013 secs (117002282 bytes/sec) 1048576000 bytes transferred in 8.975112 secs (116831521 bytes/sec) There are only two typical throughput value ranges: 175 to 188 MB/s and 115= to 125 MB/s (in powers of 10, not 2). This is roughly a factor of 3/2 ... $ t 16 1048576000 bytes transferred in 7.537053 secs (139122806 bytes/sec) 1048576000 bytes transferred in 7.643938 secs (137177468 bytes/sec) 1048576000 bytes transferred in 7.658221 secs (136921619 bytes/sec) 1048576000 bytes transferred in 7.676633 secs (136593217 bytes/sec) 1048576000 bytes transferred in 7.684927 secs (136445807 bytes/sec) 1048576000 bytes transferred in 7.692365 secs (136313868 bytes/sec) 1048576000 bytes transferred in 7.785566 secs (134682056 bytes/sec) 1048576000 bytes transferred in 7.869853 secs (133239594 bytes/sec) 1048576000 bytes transferred in 7.887814 secs (132936190 bytes/sec) 1048576000 bytes transferred in 7.902913 secs (132682214 bytes/sec) 1048576000 bytes transferred in 7.901557 secs (132704990 bytes/sec) 1048576000 bytes transferred in 7.918014 secs (132429169 bytes/sec) 1048576000 bytes transferred in 7.964384 secs (131658150 bytes/sec) 1048576000 bytes transferred in 7.973078 secs (131514575 bytes/sec) 1048576000 bytes transferred in 7.992037 secs (131202601 bytes/sec) 1048576000 bytes transferred in 8.074766 secs (129858370 bytes/sec) Now all results are between 130 and 140 MB/s. And this outcome is stable ov= er multiple runs. $ t 32 1048576000 bytes transferred in 11.279196 secs (92965495 bytes/sec) 1048576000 bytes transferred in 11.343222 secs (92440755 bytes/sec) 1048576000 bytes transferred in 11.345478 secs (92422376 bytes/sec) 1048576000 bytes transferred in 11.422671 secs (91797797 bytes/sec) 1048576000 bytes transferred in 11.522082 secs (91005777 bytes/sec) 1048576000 bytes transferred in 11.757213 secs (89185763 bytes/sec) 1048576000 bytes transferred in 11.796787 secs (88886578 bytes/sec) 1048576000 bytes transferred in 11.787529 secs (88956389 bytes/sec) 1048576000 bytes transferred in 11.830471 secs (88633499 bytes/sec) 1048576000 bytes transferred in 11.866944 secs (88361080 bytes/sec) 1048576000 bytes transferred in 11.901904 secs (88101537 bytes/sec) 1048576000 bytes transferred in 11.956605 secs (87698475 bytes/sec) 1048576000 bytes transferred in 11.952918 secs (87725524 bytes/sec) 1048576000 bytes transferred in 11.955508 secs (87706519 bytes/sec) 1048576000 bytes transferred in 11.961946 secs (87659316 bytes/sec) 1048576000 bytes transferred in 11.992837 secs (87433521 bytes/sec) 1048576000 bytes transferred in 12.017736 secs (87252376 bytes/sec) 1048576000 bytes transferred in 12.023212 secs (87212632 bytes/sec) 1048576000 bytes transferred in 12.014854 secs (87273302 bytes/sec) 1048576000 bytes transferred in 12.054915 secs (86983277 bytes/sec) 1048576000 bytes transferred in 12.149618 secs (86305266 bytes/sec) 1048576000 bytes transferred in 12.179530 secs (86093302 bytes/sec) 1048576000 bytes transferred in 12.260039 secs (85527952 bytes/sec) 1048576000 bytes transferred in 12.261602 secs (85517046 bytes/sec) 1048576000 bytes transferred in 12.260685 secs (85523445 bytes/sec) 1048576000 bytes transferred in 12.386748 secs (84653048 bytes/sec) 1048576000 bytes transferred in 12.415505 secs (84456972 bytes/sec) 1048576000 bytes transferred in 12.487385 secs (83970822 bytes/sec) 1048576000 bytes transferred in 12.527210 secs (83703871 bytes/sec) 1048576000 bytes transferred in 12.602776 secs (83201986 bytes/sec) 1048576000 bytes transferred in 12.618314 secs (83099532 bytes/sec) 1048576000 bytes transferred in 12.725476 secs (82399749 bytes/sec) Again similar results on multiple runs, always between 80 and 93 MB/s. The big variations exist if not all cores are busy, and this might be due to non-optimal scheduling performed by SCHED_ULE. It would be very interesting= to repeat this test with SCHED_4BSD, instead. Funny detail: my CPU is reported to have an upper CPU clock of 4000 MHz, not 3400 MHz (no overclocking, but I had powerd running before, it has been sto= pped for these measurements). And I'm quite sure that I had once seen C2 statistics in the sysctl output, which are missing, now: $ sysctl dev.cpu.0=20=20=20=20=20 dev.cpu.0.temperature: 48,6C dev.cpu.0.cx_method: C1/hlt dev.cpu.0.cx_usage_counters: 175874 dev.cpu.0.cx_usage: 100.00% last 6552us dev.cpu.0.cx_lowest: C8 dev.cpu.0.cx_supported: C1/1/0 dev.cpu.0.freq_levels: 4000/3740 2800/2800 2200/1980 dev.cpu.0.freq: 4000 dev.cpu.0.%parent: acpi0 dev.cpu.0.%pnpinfo: _HID=3DACPI0007 _UID=3D0 _CID=3Dnone dev.cpu.0.%location: handle=3D\_SB_.PLTF.C000 dev.cpu.0.%driver: cpu dev.cpu.0.%desc: ACPI CPU Maybe I need to check the energy efficiency settings in the BIOS, but I tho= ught I had enabled all of them again, after the last BIOS update ... --=20 You are receiving this mail because: You are the assignee for the bug.=