Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp209473lqs; Mon, 4 Mar 2024 22:24:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXl6rEK2uvK9J57cPUzYI7SK2i95VNj0SGGsN/npBso9eUq9vOftnypoiD20jIEVH59VUt1IhuBtVaxbsu5uLOlowOCXs3CxMl/ynKC0g== X-Google-Smtp-Source: AGHT+IFuYtNX/c4XpQPZ0pvQjXgz06XuIsSSaDWhlmMxKkeqxwKjauSsvG+ZS0hYYa2aSpRy+9Rq X-Received: by 2002:a05:620a:192a:b0:788:3182:729e with SMTP id bj42-20020a05620a192a00b007883182729emr1819634qkb.1.1709619882157; Mon, 04 Mar 2024 22:24:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709619882; cv=pass; d=google.com; s=arc-20160816; b=kT4JMVZbLfzwzTO+v8RWyta9i/EUom1GAqRNNckyCcS1yPckjASHGUW9B7ZW/j6W4u UV6y9BZhwoyKl0qhoxJ0FX6wUWMzPu/uIvmyggqu0WeYMIvViPYSeU7v8AVZITTJSXXI bJI11v0s1gAv3YMRdJ3KUhQ7cLu9kiOfXc+kVU4c6G1/dl6ujNZlKfdapZXxlXAbx+ku OcnnzT07Syh2y9Z8cTfx/l6vc8slwc/YhRKerlGYCTQjRm2+Xpu1/SQ59Yylrv5yC9LU 53sUgdGB8jFgRjuROlR3eRf/nZdw47eHmPz4TJqlC4nYVYrTr7TpoktaKH2ZuBKZheKI vMZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:date :subject:cc:to:from:message-id:dkim-signature; bh=TsV7flYFQYG54yZpLUHZV0gHbA6RRacBo4I7EqORDTE=; fh=5SJOQ7r41v2gxOv6i7j2hpnOgiO9ZBDcHon+Agl6l4A=; b=UI5VCr/PoxCZcyTLv2MllKHX4I5osEt5xh8x9pzgmZhCbwvkGF/GpJXgCXua40ogXI i6fjgpj/7rVLl9tLVmUF7R0EJymam8n2wcQ+qpP7EawpRGa3+FqJVodyXQtJANikLs74 eI7hyb6Rae6mMe8Hp18+RxKHCy91hFAOBqtio53OwHMFeyvCWfwADBDqXtCcS6Jv+EZq e1RsUNFHKYeRqPd7+yxViDBKxI2OmC9cJ5kQI8Du/G/geqezTS0IYdw6zRwVpJV/5ct8 yqTZQJb7Pu7KReCF+eK4XMvmky8JRJi9G4FuIrW76cTKlLus+DndnhdiMQ0bKnyrFgpc sMtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=U7NwhGUX; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-91737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pi9-20020a05620a378900b00787f4dae9d2si10974699qkn.516.2024.03.04.22.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 22:24:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=U7NwhGUX; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-91737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DF1681C20F29 for ; Tue, 5 Mar 2024 06:24:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 601E37C0A8; Tue, 5 Mar 2024 06:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="U7NwhGUX" Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB91A46521 for ; Tue, 5 Mar 2024 06:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.57.252 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709619876; cv=none; b=ayVEz21tcodXfffFxhX7OvHkeck9I1n/JyoU2Wpd0sx2PPkJqeZOPBbMIScChb82+7ofS88trmppzPAn+J3q8pHJQ8EqN0b/VEHDvulZKZFDj1IzQrEdl/NWOznsC1U8QrxZSnK5qo/tK1EkEJXZMTZTGbV+VCEWlubRacOOfUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709619876; c=relaxed/simple; bh=dE18vaGqW1u26WlxEwBm1HNfaT/R+phg+iUf/5S0VIs=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=aKQB7vSCCb2EfVqh7oHC4Cbx/vuJbRalmL9TnGrP9W2vh+QQtjk6N5A9/X1poYHUyGqbURoC2/C3WziaQHMPHSu5K0V7e9pVr3Tvhsv2v5+wskWi2JbDgIfpVM4VtYUrGMA7Fn4d/xY5KHIOzG5WTfxquLEt808EijEMUHbZlnc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=U7NwhGUX; arc=none smtp.client-ip=162.62.57.252 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1709619869; bh=TsV7flYFQYG54yZpLUHZV0gHbA6RRacBo4I7EqORDTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=U7NwhGUXf2E7agNCE4dwFMQandCUit+6OKS/xpSD+Xk5SYkjiAGOfOhWoBsdcgMpa zbqp7LF1nKsx6lcbVIC+4FHNd8F/TMVYiK+hTTeCOjxG6QeL/z9kqm/sncnPU6MKI5 cwkOfxyDmf9uruBbGzlTlA/4v1d0Xhuxzy4AxkpA= Received: from localhost.localdomain ([218.94.142.74]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 61A2EEB4; Tue, 05 Mar 2024 14:24:26 +0800 X-QQ-mid: xmsmtpt1709619866t469u5zqe Message-ID: X-QQ-XMAILINFO: MmpliBmRb3iCdtIc/8eFoFNKi2PKd+Oqlq/n3MDP5GDeJ87TlIBfCoHPDh9Glp fBOktgD+dCl5eaUITQ9mLy2lZHcw4GAcKv0wmVTYnvdPnJIJIYDiJbsAyav10zfQEvxfba91zfDH znWVbomF+mDY8MX87v75eFa6iY3K9/BjMbNboq8OcE5yA1j/YavGCo6qhkPaQG4Cy7Tazpg9A+l7 LNa7IOmE8m64g+XF2wxhhVmfdmlMuGUk70p0c3dGN6HJivq6N6zAfr6rrlUGDoe6K7MdlKOysYOR xSd+SSWObpeBk1pXY3KyljKrs6iWfMBOPiYaa2yBqjICc/wlkO/8ZNQMP8LF2U5XoAdXVweN3CS8 F+Zi4MX0xhvG1GM7dmky68xxmFD+ZN6LuCjFbwrM1O+hkgsR7dIx6GW3v2R2m4gpsdnTaRJIaj9F KLQa72fMupC6CwWGfCxbWiNJZvs76Y8O2QG4BKMg+aM6ZPsD5M4LKwXpHBCkE1LpY2ze2ZV2fSDz fxMjf0K9qBTn1fqQ2NXA4z+z0/MdGEXR+n3+V4faMV52bsMWh/GZRyQ0OUGbv5V48d+XkvfYTh+n y7hL+4L0WBFHOLvQiyu50lo0WJxNFb0gLpnHCdB02kUoVUhfY/LusGJrJkGuvHlWA6B/Ejz0ptcN lKwfuGXrgcPuP4iWbVW1wfbhI5+8foQp6S544i1HYczRqcdaPQHRORBIzaHl3itCI74FOg7Q+Nfw 4iy8L0tAG4pciNIZXSnbzDstGaxDeNK+nzLe6eoOmVKMernoYy63S/B35Koywk8pCCXj/MOd6EmG BvUN6IHJFUPktijacAL5FY/jJUjVIxxpOZj2oO9nW+wuG2zoDGRcj1US2v0UWdVv0Sdgph4ir6+K 6MDnK11qsWrN1fFrYoZ2dwSLOVW82GXKNcNaXgFBjIHuqAfs5HIO6HUF2Y7o06QdWc+/MPnq88tb P6LixdKzD8na3sAvkI0/bdwx9l143vn76pNjS6/kclPAnQOz/nF0HxMwyisOpvVJzGgZ8boKtIFJ XdAUXlMIrBIe+fZJ4WLFZKCGCSc08= X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: linke li To: joel@joelfernandes.org Cc: boqun.feng@gmail.com, dave@stgolabs.net, frederic@kernel.org, jiangshanlai@gmail.com, josh@joshtriplett.org, lilinke99@qq.com, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, paulmck@kernel.org, qiang.zhang1211@gmail.com, quic_neeraju@quicinc.com, rcu@vger.kernel.org, rostedt@goodmis.org Subject: Re: [PATCH] rcutorture: Fix rcu_torture_pipe_update_one()/rcu_torture_writer() data race and concurrency bug Date: Tue, 5 Mar 2024 14:24:20 +0800 X-OQ-MSGID: <20240305062420.17398-1-lilinke99@qq.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > Anyway, a slightly related/different question: > > Should that: > WRITE_ONCE(rp->rtort_pipe_count, rp->rtort_pipe_count + 1); > > Be: > WRITE_ONCE(rp->rtort_pipe_count, READ_ONCE(rp->rtort_pipe_count) + 1); > > ? Hi, Joel. Sorry, I am not very sure about this. I do a little research on it. I looked through all code in kernel that looks like this, both kinds are used. I also try to compile this file with and without the READ_ONCE in WRITE_ONCE using gcc-9. Their binary is just the same. Thus I think in the current compiler version, they do not have a big difference, but if the compiler wants to optimize more, maybe the latter one is better.