Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp829pxv; Wed, 21 Jul 2021 13:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwST9rwBTOXw3hjiF7Pq1qBubeqRYd+XH/riHRr/Wq+Ev3OVEAtyOd6y2QjHLXeKIZPHCBk X-Received: by 2002:aa7:ca57:: with SMTP id j23mr49739775edt.224.1626900715757; Wed, 21 Jul 2021 13:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626900715; cv=none; d=google.com; s=arc-20160816; b=BhnMfmg3Oiw9cWgFBcrkT5rOFsEE/kM34b4+g91AuQLnD3V2j7SnqxJ5zx1u3Duu5X awajknuYVt3yKTPoxN+PGWAiyemnZ6pj1KuzHyZwq6ncx4WMbIobtuvi8PsQpw0tAPmF m2XghHTML3fkqUrL3s9n11XsP8MNWgacUHX8f0DKJf4ZlFWJYQDY8caohepOrJQbjv+V 7WivZFlcnvWJjxrXVzOd2h8+gfh9yrSXc/HfyS45yoxghz3XGf7RLX0bhN+SiIFGeNZk lVnlh0zQqLyF1NGML0bssQaOGFFZIuuIbYz7S4luW92kbPKuIDk1rO2gK4KUU+JhnVMB R/RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E5h+UIxC3EX+2Dz4wC95FJ5XwHLyjBagKp1S90KKVyE=; b=NzxluYV5tWTfbeYlwretEx2xWjI8HHQUoEUyqRhZrZwYHQm8cJ7bijMl3RcQskYCjz plI0zydbbqX1pwSpODKmmwHZR/Wjkw6mQkBr92BsvpIAnbfmybxxMLTKXPmVOHtp8Nft 86z3+aru/AH44MLRE6NMhKfjT8F6lLchy0hnnp+EjKMMgSQzQIwPZcm0U3RGOe0C/Fda wl4234cNu9TNDrrDQQ3HiH4hUatuIZrI6tlSNIhJjOEEaikTniS+IDGUJQmyZRgMFZIv UzhMl7aguR8Itt15+awF7aDmVC/et4iEggQeUelHiVUtJ/uPJyNWGMvf/DUYDcmj2k/r BXBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XybP3n/k"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b3si26234033ejb.219.2021.07.21.13.51.32; Wed, 21 Jul 2021 13:51:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XybP3n/k"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238250AbhGUTlf (ORCPT + 99 others); Wed, 21 Jul 2021 15:41:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:50066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240381AbhGUTkx (ORCPT ); Wed, 21 Jul 2021 15:40:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DEF476137D; Wed, 21 Jul 2021 20:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626898890; bh=wEu8mtu9foqhl4vybGYweZH7nS4hW3NBN/vzNcI3m3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XybP3n/kcIqe8sbpm68LJpkBOtg1RehbmH5DwI2II/+DZGYFtp2oiDdIMUUygX/qH oyqIriNylwWj5XILOF29LmQEG4OSwRF41dzPwZQMQuay8MwR8MknOCO+JEnzS+/cFt HF199bgrYNTWO6hNfgu0Z4GkE/Ap1qLwigsKIRPV/ZI0GxeVzKUtyA2fRp59ixyuRn AsDIm6+jpWPdG5QHTOEQeT0iMvEV16v1F9Pulcz4yDJjbditLe7sLUAdUMbTZEnA7N d/kySepwx4db0SbuNALnTEutGYIIEN6hj7DminPbzHhqpiIo66skbhMoBicy5PnStb wH9lF/VsWR1Zw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4A75C5C22F7; Wed, 21 Jul 2021 13:21:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH rcu 11/18] rcu: Mark lockless ->qsmask read in rcu_check_boost_fail() Date: Wed, 21 Jul 2021 13:21:19 -0700 Message-Id: <20210721202127.2129660-11-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20210721202042.GA1472052@paulmck-ThinkPad-P17-Gen-1> References: <20210721202042.GA1472052@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Accesses to ->qsmask are normally protected by ->lock, but there is an exception in the diagnostic code in rcu_check_boost_fail(). This commit therefore applies data_race() to this access to avoid KCSAN complaining about the C-language writes protected by ->lock. Signed-off-by: Paul E. McKenney --- kernel/rcu/tree_stall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 42847caa3909b..6dd6c9aa3f757 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -766,7 +766,7 @@ bool rcu_check_boost_fail(unsigned long gp_state, int *cpup) rcu_for_each_leaf_node(rnp) { if (!cpup) { - if (READ_ONCE(rnp->qsmask)) { + if (data_race(READ_ONCE(rnp->qsmask))) { return false; } else { if (READ_ONCE(rnp->gp_tasks)) -- 2.31.1.189.g2e36527f23