From nobody Sun Jun 25 21:00:19 2023 X-Original-To: threads@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 4Qq3Jz5fkHz4j3Xg for ; Sun, 25 Jun 2023 21:00:19 +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 4Qq3Jz3NS5z3x0h for ; Sun, 25 Jun 2023 21:00:19 +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=1687726819; 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=kZpaq9ZjjKAvzVkrf9+z1mHbuOWYEcmeCKdYSwC9ob0=; b=RHJbcLuS4LhZFJj6CbUek1/qKI7hzRU62/Q0W7X7YkpR65fbFCXGUPSU31br1TtuO4DETP A81AltxfimHAX/ozjlD7iVpDf+fBSv59FBswu7/MfVftGE/ofgIfyyu/SH6wGjb9klAMAy 8n/weBqVuEOoz/s3Bqd7S+1M7dKEHNxPMnHiqUUeZ9GRZVmwN8ccP+M4GqHj69ieEpb0KS ku015spxI1WrgUa3wt9YQqlCkL/X447/PyTAc1FtgtkCMB/vDXtP20p6yt+kBH9pI9oaiF D4ge/QIVQ8yBbneATksYnM6FkvF2pwXwPCHG7JardFLT71DEKz27JEJNMkdqZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687726819; a=rsa-sha256; cv=none; b=JuzYlyNA5gRMA2qIkzAm6ebD3pl5/5gfT9oVTrD+H9/UNhZPnpeBJ3XCnCzANICA72Pyme STWKC4/BsmQzz2p+K9+KBeqkF4dUyFNls68mbUgC2mJcjFzq5bQIqk4ZwAdd+TiTZyNE3t oJ0Yrt4PRHomHX39TELn9VMOa51byhQppSgxFDwC76UDnmWtfKN10/NiEk68P3KrS/MiQG nDOs9kG+qjpeXkJjqt2cVbnfaDvwe7BTXpLYhqDIdbGoU6nCQ6CNeMnZ34ZaSQ5+KY/oS2 A6mRCR7MEw93gsGttss9MM3APRRJKYSlDXJfeMU6A3SqOIIwPol3fNvC+NqeqA== 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 4Qq3Jz2S8Nzj7s for ; Sun, 25 Jun 2023 21:00:19 +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 35PL0JlU068211 for ; Sun, 25 Jun 2023 21:00:19 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35PL0Jai068210 for threads@FreeBSD.org; Sun, 25 Jun 2023 21:00:19 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <202306252100.35PL0Jai068210@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: threads@FreeBSD.org Subject: Problem reports for threads@FreeBSD.org that need special attention Date: Sun, 25 Jun 2023 21:00:19 +0000 List-Id: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="16877268193.Ca2c.66237" Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N --16877268193.Ca2c.66237 Date: Sun, 25 Jun 2023 21:00:19 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 237195 | pthread_mutex_unlock crash as unlocked mutex dest 1 problems total for which you should take action. --16877268193.Ca2c.66237 Date: Sun, 25 Jun 2023 21:00:19 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
The following is a listing of current problems submitted by FreeBSD users,
which need special attention. These represent problem reports covering
all versions including experimental development code and obsolete releases.

Status      |    Bug Id | Description
------------+-----------+---------------------------------------------------
Open        |    237195 | pthread_mutex_unlock crash as unlocked mutex dest

1 problems total for which you should take action.
--16877268193.Ca2c.66237-- From nobody Mon Jun 26 23:41:16 2023 X-Original-To: threads@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 4QqkrD41tHz4g6F8 for ; Mon, 26 Jun 2023 23:41:16 +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 4QqkrD0WLjz42Rp for ; Mon, 26 Jun 2023 23:41:16 +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=1687822876; 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=qNxZaCPxAQEDloTO0qak+aivg4ocFsnH9AM7T4rsOII=; b=cqp0jpZmwmMZR4NHec7miOKcz8kPT2NS+DJzYYfylAFyB4qV9BId2830gKfaWrmUc6Vz/0 ay6qaHxmk8hA2t4ZRTK8IPNpU+vcJe5GbszzfG6HKxpDHz1z6gcZ9IrnF0Dmu8hgoIe5qw bSJNiWgxBqKRfYTzB990EB6oIsQvvuz8p7HVk4q+5uCMYd3n1/1hpdAb55+g4uQRs+x/t2 deJFJ2FeN+irDO/sGZdkCcYgml8aE06iPLh89ew212y7El73UGQwVZxk3w+KtEVxYLKRYn 695sSJdk+drorDWEg1AYz5pq2+uORdROJLL8S55fXZ69fQXBUoJongckt4xa9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687822876; a=rsa-sha256; cv=none; b=LxV0JZgHCFRrNX8kFarIFQNtivJdFeG3M90A8oiA9MEDMet2IyWE+Ja2Q4B4yogi3oarCv +DeOrqS+6sjwzvnWBzaFNVSkQZwu85lUFCFzcnuk+msFnktFBKmLQ+dIe1gvvCGvBtUgDZ wI7cqRQNjOVtNsCC7DJWKzdH04Tf/BbgJ/j6IaLvlrEQ3B42jsffawroy428zLD/tNoPFb IGKSc/yzTmG8gJRdBeYQqITwCeN+dGpE8LSVXJjsSE17pxv+6oaZYEG+qGORks4gCYmoD4 gQ8vAoLcvCyaiv7sYT8W+VVDTXiIBO4RXUdzy9CymrUGlg2evUILsRI4cxx1/g== 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 4QqkrC6kRHzVQf for ; Mon, 26 Jun 2023 23:41:15 +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 35QNfFDs098789 for ; Mon, 26 Jun 2023 23:41:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35QNfFvQ098788 for threads@FreeBSD.org; Mon, 26 Jun 2023 23:41:15 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: threads@FreeBSD.org Subject: [Bug 272238] [PATCH] false sharing with pthread rw and spin locks leads to severe perf degradation Date: Mon, 26 Jun 2023 23:41:16 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: greg@codeconcepts.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@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.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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272238 Bug ID: 272238 Summary: [PATCH] false sharing with pthread rw and spin locks leads to severe perf degradation Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: threads Assignee: threads@FreeBSD.org Reporter: greg@codeconcepts.com Created attachment 243025 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D243025&action= =3Dedit Patch to ameliorate false sharing with pthread rw and spin locks. If an application allocates two or more pthread rwlocks (or spin locks) and then heavily accesses them from different CPUs it's quite likely that the application will experience severe performance degradation due to false sharing. The problem is that these locks are small (36 and 32 bytes, respectively) a= nd allocated on the heap via jemalloc(3). Depending upon the state of the allocator they may wind up within the same or straddling adjacent cache lin= es. For example, if I initialize four rwlocks and hammer on them from four different CPUs (one lock per CPU, such each lock is always uncontended) the= n on my dual E2697a 2.6GHz server I get about 10.52 million lock+inc+unlock calls per second. With the attached patch, which rounds up the allocations to CACHE_LINE_SIZE= , I get 47.68 million calls per second. Similarly, for pthread spin locks I get about 4.53 and 50.94 million calls per second, respectively. Overall, I am seeing roughly a 4.5x improvement with pthread rwlocks, and an 11.2x improvement with pthread spin locks. The patch is very simple and ignores adajacent cacheline prefetch as seen on amd64 hardware. Developed and test on: FreeBSD sm1.cc.codeconcepts.com 14.0-CURRENT FreeBSD 14.0-CURRENT #4 n263748-b95d2237af40: Mon Jun 26 17:08:50 CDT 2023=20=20=20=20 greg@sm1.cc.codeconcepts.com:/usr/obj/usr/src/amd64.amd64/sys/SM1 amd64 Passes the kyua test: kyua test -k /usr/tests/lib/libthr/Kyuafile --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Tue Jun 27 00:02:59 2023 X-Original-To: threads@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 4QqlKJ4Xt7z4hkxG for ; Tue, 27 Jun 2023 00:03:00 +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 4QqlKH73zzz4Cdk for ; Tue, 27 Jun 2023 00:02:59 +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=1687824180; 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=t8/7QDnHKX5gWzUEPbXglhMsal803bT0h+6ZI5vg8SA=; b=PIB0BhrQ4G/18E1tqT/iXhb2bDQpKwrhMLaBcvpXifo/5xExSMtYYp7b900NP3bw1PI59c PGNyZCkYKzk+BP91S+EdaW1B1Pjf/9DTq2vGIKmEBDsUsXy9nulWz61FRxXEaVONW2q4n5 wFDx4K8OisoOoBgiNj8crCaIMPcnlyKq80GP+Bv6wJTZMDGsX+HFZN8IER3kniHU/Ajcv2 YoC8B9X3cRE7eKsOK+ExdtRhVbtekp0pjphlFAbjhUVk9bqxRMiubM2b8eXmXy1wNEBktN qdoEmimlGy3YPfcZYUCppBjtR/Iucq5+iEeVZgwP9Vjhj7wNfeK53yfclMRY/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687824180; a=rsa-sha256; cv=none; b=Fj5LZX0HEwqTxLjx4lhf54jgzLMOtaJdLiR9RtujlNegzWTem34CjCEUShJNR6SzNQmBCI aDWr6mnEqUUM0rHkyysrbLA4/PZGloNzeWauYEC3omOdX1ytsnNj/wy+S0L01YUp5N8Fnr vRI6jkQUQq64ouFw9AcM6rO5WuGttUIXsfVW0Jnq1l+jJcEbc4Jgp+no5zSvRfT707uZTG glzpNsZOo73/YoHTdPWbyqGzP6qfjSo635uoZeJUfbBjLtNoH+lJXhd6a83vq+XhuYPcsD Yuv5LxfONve1TLbcZ0mDM/5CcA0yKTr/he+WtD7jXkdbrxKUR8yzrtEX+Yeufw== 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 4QqlKH5hbfzVbT for ; Tue, 27 Jun 2023 00:02:59 +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 35R02xTB034048 for ; Tue, 27 Jun 2023 00:02:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35R02xd2034047 for threads@FreeBSD.org; Tue, 27 Jun 2023 00:02:59 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: threads@FreeBSD.org Subject: [Bug 272238] [PATCH] false sharing with pthread rw and spin locks leads to severe perf degradation Date: Tue, 27 Jun 2023 00:02:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd@igalic.co X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc bug_status 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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272238 Mina Gali=C4=87 changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |freebsd@igalic.co Status|New |Open --- Comment #1 from Mina Gali=C4=87 --- Hi Greg, thanks for opening this issue. we've been trying to discourage submitting patches thru bugzilla because th= ey tend to get lost and forgotten. this is small and self-contained hi that by our new contribution guidelines= it can be submitted via GitHub: https://docs.freebsd.org/en/articles/contribut= ing/ --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Tue Jun 27 00:08:05 2023 X-Original-To: threads@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 4QqlRB1qPxz4hqP4 for ; Tue, 27 Jun 2023 00:08:06 +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 4QqlR94VTKz4F59 for ; Tue, 27 Jun 2023 00:08:05 +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=1687824485; 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=1CBx5aV+kBVVVFzGpZYXtFCnQjUsxAzv/3FlGEOiQP0=; b=dGghN6yXdpmGi+A9GeJcIjC4SXDtWhq8yVbRQq3sFodZv/CJJU15MK5oov1IHSGQPIkc7b nupNj7qK0mYYtaRjIgUe6SKEMOx7Ti1ypL9z9IgeahEFxLi5+6GX4SKvXMZVCJDv+2JAvk IwHGKRtP6JMwn/7/5vQFo1H6w4l2hDCZID8eAANxIrQAHq1jtm56BWCvFRmQaxUtpP/XBc IuFz2iJzrTPJOVlwl4JdFlzb5+Bhpknqg+Ux5sWQBr5p5f7kqtHwPwEFAWdwGyiF0lqXAJ IcrS5CpFgBLQ97mTtCUDL8rw4+ify2GmR6/Fl8d17PbwJ43PKKupoP0VXpecWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687824485; a=rsa-sha256; cv=none; b=mXkuQbd2WlckrTM/rMxR5BdQE1VuDbw7Lzf9qpRasTT/10struRoKQIwI1lkjN00siiJia yG+bS9LeFca5Z3wXYBh5ZUJph4xqHahr+dcJ88vNA2lY8ia+b51u/hSXE0pruJqa6BY2WL lk/BEFVU6PH67GcTgg+na1naMxLp/a+JvPMr/jffLwDM/XyfOWEHu7XolAKpK/AUS3Le+M gw8AsCulxEUqSU9vbinc3DQ2orRtNzHNHoeaZmx129rDDQJLwjjvDwzQ2gttlH0Z06d0HC ecYI3LA0flw4qaiyNksPukyfZzIOYPrlnaCkJDEBcn4r92glDHIkRU9B+P8vQA== 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 4QqlR91q18zWG0 for ; Tue, 27 Jun 2023 00:08:05 +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 35R0857I035943 for ; Tue, 27 Jun 2023 00:08:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35R0851X035942 for threads@FreeBSD.org; Tue, 27 Jun 2023 00:08:05 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: threads@FreeBSD.org Subject: [Bug 272238] [PATCH] false sharing with pthread rw and spin locks leads to severe perf degradation Date: Tue, 27 Jun 2023 00:08:05 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: mjg@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272238 Mateusz Guzik changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mjg@FreeBSD.org --- Comment #2 from Mateusz Guzik --- Huh, that code is pretty nasty all around -- even with just one lock use performance under contention is lower than it should be. That said, your patch pushes it forward even if one could raise some cosmet= ic conerners. Preferably you would mail git format-patch output to me so that i can git a= m, otherwise I'm going to write my own commit message and set you as the autho= r. --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Tue Jun 27 01:08:10 2023 X-Original-To: threads@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 4QqmmW0Grdz4hxW4 for ; Tue, 27 Jun 2023 01:08: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 4QqmmV5NKpz3BtR for ; Tue, 27 Jun 2023 01:08:10 +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=1687828090; 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=5qRTO3yTHCjscJ4k1qJtOSY+lGB8bjyCHsYuFvMEjVk=; b=UVw6rwE4O1vEzx+jhZr3aBw6wXaRId83EPhs4+Lmg+iLS3XKebs31xgEnXrl2Os0FHhjuH uJ/ngv4NpuPeMTvvoay4ATNzElimtHzmv5lZ3WHhPDpNCF+NGYUFxxEPP3HTtdPpVlXYiN X1tJ37Lhnv8+eKdSIxfG7VWK7/jxqHEggmjpJjw60ECWSS2zXSjGAihigL3cYILZNjnE/e I232sq4vlN04/04/aIIpOxlG0fXO3VWuiXq27Y3k8CIQNJXQVD860w7X4AksDa46ZoaZMM Tdtn/JAPKX0EhRvMEGr+I2teeiZJnOrxYg9BBvuQ/Bns3NeEFyGX+4RlShgE8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687828090; a=rsa-sha256; cv=none; b=TF+Wb8HSn6M56/4lpmdkVFRaA+pNHHfg1LuG1ZQJvyKD2KiV5VDLsjiRu7AiltMsIdc05T W3ynA/ot/Q/00uZqkdqB6k8Q4FebO3JEVLs9GeAjhyEbjWTPWNVdaxVbdYUdpRtuhEKuIG 73eOQomRo5pv/8gQVC9/HqRuy6KeuZQ1dTvyVQaimJVc4Lj+tYXqvr78Qor303dL+YJiXP OYkC5HclEbRn5wG5AwCsaK7OoSD/uduCnoXuYNTukZ6lXj/Iol1Rp4O00Qa8DZ+dA16mks M/jiE0DsR+dfiuGUPTTY3PGUiIC4yw1aVtsAjvYPsX+8miU/4haly8mbQGdliw== 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 4QqmmV4TkrzXS5 for ; Tue, 27 Jun 2023 01:08:10 +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 35R18AsO029589 for ; Tue, 27 Jun 2023 01:08:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35R18A46029588 for threads@FreeBSD.org; Tue, 27 Jun 2023 01:08:10 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: threads@FreeBSD.org Subject: [Bug 272238] False sharing with pthread rw and spin locks leads to severe perf degradation Date: Tue, 27 Jun 2023 01:08:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: performance X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: grahamperrin@freebsd.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords cc short_desc 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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272238 Graham Perrin changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |performance CC| |grahamperrin@freebsd.org Summary|[PATCH] false sharing with |False sharing with pthread |pthread rw and spin locks |rw and spin locks leads to |leads to severe perf |severe perf degradation |degradation | --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Tue Jun 27 01:26:59 2023 X-Original-To: threads@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 4QqnBC6qNbz4k2Lr for ; Tue, 27 Jun 2023 01:26:59 +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 4QqnBC0p3fz3KNc for ; Tue, 27 Jun 2023 01:26:59 +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=1687829219; 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=w/roIsGFqgJOLVOOiOXYZ+q/QjBh8xM9dnm1mxnqDxQ=; b=wPvoyI1fvpEZ9iKlbkXzNErrq7FdOwsYm9O4RN2ax6dcZyCt4vJjFF7qJaZKVjfIZoDjJw 6w0ANwETbzEO91S6l6bLCycLsqza4AY1VEbm172iL10TKaAOrDpBUgWeEgkIfdXKWJ67yX 9FeCbn8i5bOOVeFuKULYmp68BdaHzwcX0Kas+TGBpzytNOC/qsCAGGAUkyfoiHryImObuq zLzX0jYVgt2nrSm2tYKGmw9rlaGUZ4FgCv6HBH9f5jwlm8i92FHfX7cOt/9bu5qpPSZMjO NSZJ1SVxF4Bzt5HkOM6NIJ++XPUsna8CN1TncaQZtOanZGPiZuem3WGbhBR4xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687829219; a=rsa-sha256; cv=none; b=H4gp+tSnLBKKVQ5rou7PLTbwfdOQDvh4UBQhqAyfJMI5L2h23OoPFjJxHMURoEwTyoURrI ydwRM4bxr3S3Y/Ll1xObfzuuYs7kmYS176NIZ1Va8NUqpPE/oF9cb7lXMTmssEPUKXrT56 8BECCyaQY3D6TKkOmkAqZRF08VMQMzLNYIZgDrhkbVKCnyscY5LoID8fbzHgxF1TGlwdKM JYkJcuRFpXFNJGQVXjdllMfIvfbKb2GYtBIVeEcyuMRTiLB+6giTu3eJwzGa1/layp6BWE 1NsBO97abeiQyeVzMFSgaqy0ryBIXev4CDIMl5Ao3YOFqRgSp6ejMIny0ZLwkA== 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 4QqnBB6wjMzXKF for ; Tue, 27 Jun 2023 01:26:58 +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 35R1Qw2j059883 for ; Tue, 27 Jun 2023 01:26:58 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35R1Qwsi059882 for threads@FreeBSD.org; Tue, 27 Jun 2023 01:26:58 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: threads@FreeBSD.org Subject: [Bug 272238] False sharing with pthread rw and spin locks leads to severe perf degradation Date: Tue, 27 Jun 2023 01:26:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: performance X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: greg@codeconcepts.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete cc attachments.created 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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272238 Greg Becker changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #243025|0 |1 is obsolete| | CC| |greg@codeconcepts.com --- Comment #3 from Greg Becker --- Created attachment 243029 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D243029&action= =3Dedit Patch to reduce false sharing with pthreads rw and spin locks --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Tue Jun 27 01:32:49 2023 X-Original-To: threads@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 4QqnJx6TmCz4k7Vc for ; Tue, 27 Jun 2023 01:32:49 +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 4QqnJx1KvJz3MY8 for ; Tue, 27 Jun 2023 01:32:49 +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=1687829569; 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=kXJ9IzW4LD5Bw+eGBlo0i0A8foKvSTbsOhV3Y2gjN4M=; b=FpG4V77hxcg8wgZvjRyxNwNk3gQJSLC43X/JV42WnEBjoY5yBxK6H612ODfOC8q1FfhuVw bFSPeNChH5mBZUFPFuffF0re2LcdVmh9aK513XFCyisdHLD2aVdYHLT8cwp3fIVviknmnX hFa4h6tblbuO8MVFjdRzVVpHMvfD7xoGD6iqd8kr+xx5wvkkr9AhY/Twuw9pTpzOJWOo4s sa33RX5t6HP078c8cT0WARIPBkY7cHdwcmSgCXz9s/UTWhV58Z3UW72sOzbTqNLvsLYHeg 01Ih2sLQos1ue8StZ2WZE+q0vUaZ9l1oSEwWKjaZPZQIxyetvhx//4YEcopZsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687829569; a=rsa-sha256; cv=none; b=qAoufDEg8s0AoIUtWXt8vDS0gk3q7damgl6jDeeFoAfI+4+DNs4UJ7IbCVNkltwsr30MAX 6VaVEkUAGkcyUTl4mNjk7nLgcnfhZS4VkkQWhMEdezZ+WWiESvpiuvRUtvkW4f8YmnF6qd dfZybLJ21RIhz48QWGpRUBcRPusNEK1E+RsQMdCOJXf4zLlJKp8iSqDMmTwoKQ2/hRuHOM nPxz+3om5YzxilNUOkv1+7PJaD0YTCSs/OBcVx8KmhRf9n+Wf2Vjhz0se1zleJwMgoHwyM Vo5g7rrFM/Yfygws4Z9dmJ/NV6dKGl+srm9aAjjm6TY4RfFz5mANfJAbWV2XJg== 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 4QqnJx0PDGzYBf for ; Tue, 27 Jun 2023 01:32:49 +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 35R1WnEB072008 for ; Tue, 27 Jun 2023 01:32:49 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35R1WmZK072007 for threads@FreeBSD.org; Tue, 27 Jun 2023 01:32:49 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: threads@FreeBSD.org Subject: [Bug 272238] False sharing with pthread rw and spin locks leads to severe perf degradation Date: Tue, 27 Jun 2023 01:32:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: performance X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: greg@codeconcepts.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272238 --- Comment #4 from Greg Becker --- Mina, I can resubmit via github, thanks for the pointer! Mateusz, I uploaded a git-format-patch and will email it to you as well. Should I revert and go the github route, or just finish up with this one he= re on bugzilla? Agreed, nasty. I have a few more patches to improve mutex and overall performance of pthread locking. Thought I would start with something simple first and get a feel for the process. --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Tue Jun 27 11:57:07 2023 X-Original-To: threads@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 4Qr39J54bSz4hfKs for ; Tue, 27 Jun 2023 11:57: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 4Qr39H5b2dz4LbG for ; Tue, 27 Jun 2023 11:57:07 +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=1687867028; 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=Vpsam7wSHM6VeT2ROB/BldxNI8AHPtfx6yaQ+KUuTgg=; b=XmFWoWcothT0z5Nu+6k13FJsEU4Y+D37z4EZknJnVxFSE79EymAIz5kWyAndemGKHB4Jks rq0Jp3hyohSI32/SJZMtbzhwXZRDcwovT+Qpor1z2avKF7rjSELO5uCulmolwA50ex4CTw cEA60E9REBZOAeq/yOBpwBM6Q8YnjBgf8CrBfH6YTD2ga/z3VOLJv1FJDCbxQXsE47ZPCr gd4XrpfkMsIJDcpX0EPLKjknXQwshLt2iG+udFmjNvE5ll4YIEK66mq/ks5KCgtYBr5KNY NAPrCAHrkjYd2wLiNDT+GITmUerHfsesqIVnlfAjskHfSIR5Qm2pw5S4xLd+AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687867028; a=rsa-sha256; cv=none; b=aoMDFtjxr9Glp06ttMuGv41r+fe7rx3r4VsuDVT5TA9UrFvX/vr2VHR1PQjB20pFA8twbQ oYjNKRt9YXiYyhd3m6tk2MirK+c2dmK7uV5Mp16REPF2yJjth9H0n2NZOROrI7uCVL9G93 qGh0Q2HDteRg1TXc2rUt3mOTMeCrtE+xMFI+NOSeu9ZOcVGaFTyHP8Ksc8u7geujN2+wat luQnd81y0GnN2KNFJU04Ld9MYQJjHc7l14keFdtvil4cxj+OBM82ql5S/ASHzv88aXHcZ4 4mKFJObjeFoPg5c4E5lw7x+m7qRhQ/ATusuyhWpLH+pj8C02aoCXHrQ5gFhA1g== 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 4Qr39H3sB9zrGk for ; Tue, 27 Jun 2023 11:57: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 35RBv7AZ038133 for ; Tue, 27 Jun 2023 11:57:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35RBv7Wq038132 for threads@FreeBSD.org; Tue, 27 Jun 2023 11:57:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: threads@FreeBSD.org Subject: [Bug 272238] False sharing with pthread rw and spin locks leads to severe perf degradation Date: Tue, 27 Jun 2023 11:57:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: performance X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272238 --- Comment #5 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Da6c0d801ca5934bb9b9cca6870ea7406d= 5db0641 commit a6c0d801ca5934bb9b9cca6870ea7406d5db0641 Author: Greg Becker AuthorDate: 2023-06-27 01:08:29 +0000 Commit: Mateusz Guzik CommitDate: 2023-06-27 11:56:44 +0000 libpthread: allocate rwlocks and spinlocks in dedicated cachelines Reduces severe performance degradation due to false-sharing. Note that = this does not account for hardware which can perform adjacent cacheline prefetch. [mjg: massaged the commit message and the patch to use aligned_alloc instead of malloc] PR: 272238 MFC after: 1 week lib/libthr/thread/thr_pspinlock.c | 3 ++- lib/libthr/thread/thr_rwlock.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=