From nobody Mon Sep 02 09:12:47 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 4Wy31r29XZz5Mr7V; Mon, 02 Sep 2024 09:12:48 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy31q6pfYz4Cc5; Mon, 2 Sep 2024 09:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268368; 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=jvylgYgoruarWN75cRWGqmVv1JprXwyGRBCMh+yOYTQ=; b=LPmH+uMrevcVGu8rC23A4Y4FYBMjRDdysEe/HKhDfgXRsitDy+IREtOR/0jzgEbTayhoU6 qON/sC8uWTjmB4IvSiZBRlsecnICfeHGJiIOGXEPOjNrgmk7kxQ24l9u8SrkQez57H47bJ gRb1MVbVJfnNvwngXGcd7wpFEBiB2GJKjcB8l21Zb2x9R1G4WEgoVuwGw1Rz6EENOORX4q JG9P7pE6PuqHEv1892r5kSFBPV4e6F6GujdjYQXqlVv2l4iT5sB5/MR0MFKGSgEbnDcWVG 7RtWewcPMOgXnSf+s7qG/3lAh5kXLwuWAs7ePfpesDrEVS3QbEwgLRHEqdFr3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268368; a=rsa-sha256; cv=none; b=y3Js7h1jcHrQ7QbktBY4FTXHsbRT/bvE9e6s3bNNjC/xsbV1iHL7B38PvKPFPX9HAxOjQk aTVTwTpJcVbgQGAlIAMjzJeZ8BnRass9WnuKvAOxkVcVMi75DLO0z441jtaWoRgeADDY8m V/4bz6i3u7IVAcVVkyCkN5IW9LNQPDMTDmyTw1441EZgGG2bgzYPwQaqio+ldG2nqi72hc pEDBy6Fd7+kRjtVWY9eiH1r2iCwqALvq6VGTkiMTnlUNWZGC5jFwr8s+hvIZqoZN+YtvgB 1RhQdoESReLG8NJPkTq0GYP+zNgzTdwRocPkkwP/O8bgGDP/ylXyqkPYOQmmpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268368; 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=jvylgYgoruarWN75cRWGqmVv1JprXwyGRBCMh+yOYTQ=; b=Dw4BT8Tprp7zQ3xXtOROfZfQdTz5xe/TfVPKpDAV7wxUwwCx7+dc+mT1Qx3es53GGg98/t TPaosRwvtL9WVJQ9APS/mm7ooG/I4wXNBupIPsIqly1+EA4F8gpNsODUolKW+KQ7DSiziA cFQeT8wB05AcPz0UMUX9Aus12kSIcIXKPyBBgmc9CSOjPxy6dVSd85C3dU3+j5sliDIsB2 oZcVXbgrQvo7nW1C2GjrhOJsh0gdm/d3zF+Oen3hcJ0W0OoFeswUrKwlgc4oVhahoLgNaI 9Ik1Jx1IBEuMdNPQ/vtMRsGYDgXis1qY9v3oFm6ZbHgNBaLvgOMqDEpOZWd3PA== 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 4Wy31q5w5wz15ld; Mon, 2 Sep 2024 09:12:47 +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 4829ClGO049978; Mon, 2 Sep 2024 09:12:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829ClSP049975; Mon, 2 Sep 2024 09:12:47 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:47 GMT Message-Id: <202409020912.4829ClSP049975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: b5410efe42c5 - stable/13 - buf_ring: Remove old arm-only dequeue code 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b5410efe42c5bcf78d3f41052266a758e4fd03fc Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b5410efe42c5bcf78d3f41052266a758e4fd03fc commit b5410efe42c5bcf78d3f41052266a758e4fd03fc Author: Andrew Turner AuthorDate: 2024-08-19 09:07:10 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Remove old arm-only dequeue code In the single consumer dequeue the consumer thread controls br_cons_head. As such no ordering between this and other data are required. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46153 (cherry picked from commit 7eb0fffc7792bc294d6b86546a3923e2e2f83f8a) --- sys/sys/buf_ring.h | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 9aeb5aa19fa8..ad463fba27cb 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -177,37 +177,8 @@ buf_ring_dequeue_sc(struct buf_ring *br) uint32_t prod_tail, mask; void *buf; - /* - * This is a workaround to allow using buf_ring on ARM and ARM64. - * ARM64TODO: Fix buf_ring in a generic way. - * REMARKS: It is suspected that br_cons_head does not require - * load_acq operation, but this change was extensively tested - * and confirmed it's working. To be reviewed once again in - * FreeBSD-12. - * - * Preventing following situation: - - * Core(0) - buf_ring_enqueue() Core(1) - buf_ring_dequeue_sc() - * ----------------------------------------- ---------------------------------------------- - * - * cons_head = br->br_cons_head; - * atomic_cmpset_acq_32(&br->br_prod_head, ...)); - * buf = br->br_ring[cons_head]; > - * br->br_ring[prod_head] = buf; - * atomic_store_rel_32(&br->br_prod_tail, ...); - * prod_tail = br->br_prod_tail; - * if (cons_head == prod_tail) - * return (NULL); - * ` - * - * <1> Load (on core 1) from br->br_ring[cons_head] can be reordered (speculative readed) by CPU. - */ mask = br->br_cons_mask; -#if defined(__arm__) || defined(__aarch64__) - cons_head = atomic_load_acq_32(&br->br_cons_head); -#else cons_head = br->br_cons_head; -#endif prod_tail = atomic_load_acq_32(&br->br_prod_tail); cons_next = cons_head + 1;