From nobody Mon Sep 02 08:50:54 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 4Wy2Xb0LhJz5Mp6m; Mon, 02 Sep 2024 08:50:55 +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 4Wy2XZ6cMtz42md; Mon, 2 Sep 2024 08:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267054; 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=eGPJKDw7lpWixfg75LaM//VdNbJnlrPut6do6exlhnM=; b=VFwTiqzeavU+8mQ0US5A8D3pEREp0tR++l7Tah8CpDOHCV/CvOIMt33L8daGQNDvBHjS+V v9PAQfQRTjTx/HVLtjjK3ze1iFGQ9r9bgj9hBUxUoUt8NKyKT1sFpgPQb4bsTSOQjAGyc3 Se05bCC6kdjD42wLCuBBn2F523CwUVU6OYf4RljfOO3mo3AYsZ1HZ7P0/kxy+L/vgqSVrn SnGSsSijZFicrhT1GoZGRgivYJavwCz5nmqSInjDKfBPrX/6IOyJZ/qjVX44XCrhP7T9PE HqGZClnf5bTQ4TdNV4PdmpkRz2tYCLryLLM14wzz0K0ftN3V86wxxub7/C7LGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267054; a=rsa-sha256; cv=none; b=cjGfx2ne/WWGKDh82PspSj111hrjR60ciIf4BUTO/9nLFh5uyUYAFZABbCA9r4uxS2qSD6 U3bROBW9sIMQDg+0T6rCM5ItJDTD3iy5jo8vnnIcsp3qY1//FsnQmZGkhR0SbAD/4j6/wh Ex7/7N7S6/J9Itf0Ga8I1I5Cmohmm76zCX/7FU8/IgA0m2LEDBCsXnd0FG42MB33xonKDC PacN1E1lc7gEJzpJubphrtRAsnHUF/9Tuvzazi5XD6TZrcMmo2eR2YnelNF4kABqBntgOC 7mjkpU7A2cSgRc80wBUz7MVJnKL/KTyauhovhFczER0ogtb5TMh0oZF22rkPNg== 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=1725267054; 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=eGPJKDw7lpWixfg75LaM//VdNbJnlrPut6do6exlhnM=; b=keMSXekhuy594DsQjC5pt2CCV+Dar2fNb3tYS2dJNFdoH75e7n4HqGWUjvLkQR4sI6bjBP 1GoVyB94msjtxiF8b3NzxiqDR84tCF6f5ie3ucYkqeV59IjstfSLluW/SeKi3akG4BMYXv n6cD72WcU3BsFqxoyk6wD88TG7O4JbHN6LPkHocaYKLfGyInxyyFwrBQ1N2FtZg5Kk1o9h LpQ2SLEgmZRsOaZ650uF0r3X5thnQVSlWlSgSPMvaYNcfhvwPLedSsmf0VQqeINnyrvGC9 diRDnKCuVBD5jUMw8HfjSffmHf+Zv6YE/s2XoNlwjPf1Ah0LEM9c99YTwN8Dew== 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 4Wy2XZ69pPz14qQ; Mon, 2 Sep 2024 08:50:54 +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 4828osa4007653; Mon, 2 Sep 2024 08:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828os6C007650; Mon, 2 Sep 2024 08:50:54 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:54 GMT Message-Id: <202409020850.4828os6C007650@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: 14c779e5caf0 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 14c779e5caf09746a0e098378c2c09b897f0e177 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=14c779e5caf09746a0e098378c2c09b897f0e177 commit 14c779e5caf09746a0e098378c2c09b897f0e177 Author: Andrew Turner AuthorDate: 2024-08-19 09:07:10 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +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;