From nobody Mon Dec 09 15:45:04 2024 X-Original-To: dev-commits-src-all@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 4Y6R5D2mGDz5gS3W; Mon, 09 Dec 2024 15:45:04 +0000 (UTC) (envelope-from git@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y6R5D2Ftzz4Nrb; Mon, 9 Dec 2024 15:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733759104; 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=KJd7NIL50KkuRmhComfUED8MLF76pN1nc8j30Tein1c=; b=RC/HdvEEjNYqeDn0B3hBcHdV5WokycJjp2n3TyB9ksWFNfe5zNzJ0Rpnfbcp2YNtO72Cga x+1g0nlQYT2p9capJ6GD7JLqEntl33YEvXJ6YpXiCEac5Z9OkUISWkJ2xvpjqaWBmo5mKE Y6Es9WRNWCnE+Ye3Qu56Xu/CU3a2RRTMU9CR+oRbUxcLDdap5VNhWshu1EF0YucuAZeTqS Xx9zNWtU/HDRLberwm9Ds4n1WuVvlNNdxuWCO6y7zrFJvruivmnvdtcARZ+kv3Wf4Y62yj 62JusPEvLriszTbvgNpjvqCCCNxKyt0e0LIb98ZowaMC70s0q1IZNRHylHh6dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733759104; 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=KJd7NIL50KkuRmhComfUED8MLF76pN1nc8j30Tein1c=; b=MUK0vTtv+ntuEfWrWhWdEW7RkilyX59qcW2CUvfxCcZHSLo2Gf/mFO0M52Q2EkJBOhyuro RphCsERT2+RMeDdxShgRuS17ySJ6QcC0sVc9bm2heG96fk/vLvpJy7b6Onosi9qqw6vOax bPWndFYGa8gODVN4q+Am/skO1UKmajcdBylGBY1Fn+EzjcU1+k1ekdTdYSdnUFFCFfDo63 JfYapYKFVaOHlhjcZ2oB5zLAmDXvOuJGj39KxMlGUCaF8fNvWr9wDayLF5CmrE0yHVUI/o zR6gTOgCuj+Vt8jqPYEc16MqifiBNVj0gT4ADg0xqE45UjXHC8H35VLUoASiHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733759104; a=rsa-sha256; cv=none; b=nbf7/EudrizkFQNmYoyJBLdh34BMJnHO5CZFF2S3C28KhfCWXFGN+ch/T1yp2i7tG8BVwt if/cNkM/T6zC/fxVqDtkh48X9mQ8pQj+mmlPnPM/6v9xpKb21so8rD97UQAo1DVV25FXJ4 CUwq7FVzC46nTyMH8ZfsILtcS6elFDHXniluZrfumGVHkUI9T/LdJa5+ohejISSJdMdozq Vh81kX4s8cZNxRmLJy9hy9V+JaB3kL6rdMQStJMEUNUsf6QYVS0kbZ4d6Z4Ojg38nHX+sa +k0E3dTxmPfQHQKSETKNUAu25TwECa5hE8Tpzr6HbBxfzcPp5MMByynb6HAE6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Y6R5D1spNzkZZ; Mon, 9 Dec 2024 15:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B9Fj4dJ062460; Mon, 9 Dec 2024 15:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B9Fj4MS062457; Mon, 9 Dec 2024 15:45:04 GMT (envelope-from git) Date: Mon, 9 Dec 2024 15:45:04 GMT Message-Id: <202412091545.4B9Fj4MS062457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 65ec52e6e09f - main - buf_ring: Remove unneeded memory barriers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65ec52e6e09f8b2a610a26638ff65a35ee5557b4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=65ec52e6e09f8b2a610a26638ff65a35ee5557b4 commit 65ec52e6e09f8b2a610a26638ff65a35ee5557b4 Author: Andrew Turner AuthorDate: 2024-12-09 15:04:37 +0000 Commit: Andrew Turner CommitDate: 2024-12-09 15:44:30 +0000 buf_ring: Remove unneeded memory barriers We no longer need a memory barrier on the compare and set operations. If these fail then there are appropriate barriers on the loads earlier in the loop, and if they succeed then no other threads can be accessing the br_ring entry so any store to it is safe. Reviewed by: alc Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46381 --- sys/sys/buf_ring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 9a4bfa9fb549..ab7e683ed0e9 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -116,7 +116,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) } continue; } - } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); + } while (!atomic_cmpset_32(&br->br_prod_head, prod_head, prod_next)); prod_idx = prod_head & mask; #ifdef DEBUG_BUFRING if (br->br_ring[prod_idx] != NULL) @@ -163,7 +163,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_exit(); return (NULL); } - } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); + } while (!atomic_cmpset_32(&br->br_cons_head, cons_head, cons_next)); cons_idx = cons_head & mask; buf = br->br_ring[cons_idx];