Received: by 10.223.185.116 with SMTP id b49csp1025579wrg; Fri, 16 Feb 2018 11:02:41 -0800 (PST) X-Google-Smtp-Source: AH8x227umxnkjbLUxGjz71DwktFYu3ORKUW4fpgHMEpnR6JsuYb46mrC1V3tKGZZFLvPaJ0JmkmJ X-Received: by 10.98.35.66 with SMTP id j63mr7016828pfj.140.1518807761362; Fri, 16 Feb 2018 11:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807761; cv=none; d=google.com; s=arc-20160816; b=WdzUg65wVTbRKMvZlFa+0+G7+OHwbiXEliDx1GGRYYDM3tE7LWr7etO61JUutynLzG tEleI4symznbZkVi+3LpA8rm3KSoelnkRZdYcKNQONJ83nEpTp0YkaH12kcyT7sJxhtm Y55HozPmrUXykryhrRGxwsx0JgFUBNRpTmEuvHC4fpBtzkGEuuQQ5Pm78z/7xJb7Kgha rLEdVlCOdXYYKQ2iLYXtNa/Lzahvx6p7xWd8W/ZwnvvMVVGkPrtVewcNMt0FAIeBe7by 21rFk3t2iMIvTf5OPAzyE4tydbjjuj6UW8aMlBNDdLnugedms9G0LpNgoD2rtZMo/dG7 Yc6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=jnIcR95H/3yy0tq1Q390zAVBdFwVh3J5dOhB8Qih/iA=; b=vpVLythQsqWvGzwDH8VEM6pOjHaVlmyFcWqaCLiY/JWsDv32tsK3OF2HQtZWgJarb5 UJw9ahuQ6cSI24a4ULsTi++NGdTTFnmN5QOyq2oZOpyEh5cs3fmBL3u6mE0DT/riS3eW KTZmrzIGqEkYY12y7YT6CkzFzapNdtCBxurfxPHxHqSWoe23vF6j8M9JXfYundv8MgwA a6XkOPF9Aih7styR42uH8ezlRODsYTaTEegIKHzBhm6WIv+jbl136UXRcSez9dq+DC+0 e0mXcbxsm0YbPNgQ4PCtXBoigNkAgCcQ7a2d1/GcWi8xyn3tzg9v2wnhGn4neE8fm4Wg eh+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MtV0dL+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k136si1763720pga.44.2018.02.16.11.02.25; Fri, 16 Feb 2018 11:02:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MtV0dL+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935207AbeBPLGb (ORCPT + 99 others); Fri, 16 Feb 2018 06:06:31 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55675 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934998AbeBPLG2 (ORCPT ); Fri, 16 Feb 2018 06:06:28 -0500 Received: by mail-wm0-f67.google.com with SMTP id h74so2465162wme.5; Fri, 16 Feb 2018 03:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jnIcR95H/3yy0tq1Q390zAVBdFwVh3J5dOhB8Qih/iA=; b=MtV0dL+bj7OmVcHgw/PeoFImKLH0MAsaSedafwoasuYkVz34tZqubd5MdrOyLlQRa9 k7titPivAx87wlQskrSXepLl8wFHDdbbWJIQq+AbhvDlaUnjXQwXdx4ioezfFyHExQ+X rjfmqf+fI0dkhw+6D7jvtrdLHgTB86aGJix8ZjYWHl9Ie7z0mezTTetKDe24BTV49KFk s+UCN2kIuhrslGHsrTz4p+kyskQeDyMRIeCwyPF3SVAE07EvguyFXfuntkNuhS/93XsB W1AHwjHjdXdLUfnvPfBK9xpPTLatqy44r4PwRZ0xexJ0jtLnOGeeXAwEImpY2eBQL04f r72w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jnIcR95H/3yy0tq1Q390zAVBdFwVh3J5dOhB8Qih/iA=; b=Y8OFXrvF/3CNNEds2TINMigWe6hy16yxbAvTjwnU2nlTIbyHLGUi3RZKGW12lhN2b+ /ux1LU6dXPB37lVpVH26COYJPEdPFd+nFgk7EBIgneEkGfd6L+Y5bRNiFESXHZ4mMM3A y6W4o0hvJ8E7+SDVoGqLQSKLDvTV06zzZpZAfihVdMa4ED+qnCteu0c57svPOfiyk5ij vbZ89sMT3ar2LYznbhaRFvgbZiZl82yIYDejvE7etHsrWmInILRQ50vFsPfHGjozj//O yzMJa/5MXT2PoV4dUQ92Dvw7RtlnPPHLztwPNftHg5EEN1MKG2S9Y3QLQUtGnTc+23+9 sSsQ== X-Gm-Message-State: APf1xPCozpnRpOzrxY68Zxa6MR0YOR6EgpVVT6RakNhbp9aeasXaQaci Iro7WsZNO33EYO//rXO2o+IAR6rQ X-Received: by 10.28.235.17 with SMTP id j17mr4855107wmh.52.1518779186410; Fri, 16 Feb 2018 03:06:26 -0800 (PST) Received: from andrea.amarulasolutions.com (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id f19sm13404191wmf.23.2018.02.16.03.06.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Feb 2018 03:06:25 -0800 (PST) From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Andrea Parri , "David S. Miller" , "Michael S. Tsirkin" , Jason Wang , John Fastabend , Eric Dumazet , netdev@vger.kernel.org Subject: [PATCH] ptr_ring: Remove now-redundant smp_read_barrier_depends() Date: Fri, 16 Feb 2018 12:06:13 +0100 Message-Id: <1518779173-30812-1-git-send-email-parri.andrea@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Because READ_ONCE() now implies smp_read_barrier_depends(), the smp_read_barrier_depends() in __ptr_ring_consume() is redundant; this commit removes it and updates the comments. Signed-off-by: Andrea Parri Cc: "David S. Miller" Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: John Fastabend Cc: Eric Dumazet Cc: Cc: --- include/linux/ptr_ring.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h index b884b7794187e..ddfed1dce9369 100644 --- a/include/linux/ptr_ring.h +++ b/include/linux/ptr_ring.h @@ -296,13 +296,14 @@ static inline void *__ptr_ring_consume(struct ptr_ring *r) { void *ptr; + /* The READ_ONCE in __ptr_ring_peek guarantees that anyone + * accessing data through the pointer is up to date. Pairs + * with smp_wmb in __ptr_ring_produce. + */ ptr = __ptr_ring_peek(r); if (ptr) __ptr_ring_discard_one(r); - /* Make sure anyone accessing data through the pointer is up to date. */ - /* Pairs with smp_wmb in __ptr_ring_produce. */ - smp_read_barrier_depends(); return ptr; } -- 2.7.4