From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 D0DB647CA71 for ; Fri, 7 Aug 2026 13:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786108763; cv=none; b=kkDk0hj/7zkPT14dX5O7GN+0/7vqCOjF78NAwdhtFa1cAsmKQb0ftCyLTrnqZW+N3f/7Kk7fhrQeZ6XPUiarNNv81/oTylVeuLl0VOgPBfCh9DhBzzgNJ6YmOeW2e/ge7e3Jd+ensotsD8T+X4KmBYCVOK77Lrf2Lvq1oMt2tbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786108763; c=relaxed/simple; bh=YgPMC7Ira18xwJ5ha7GUMfMNw0zmhU69brfe/RgrRUc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PnnS2Dv+cakNA3nckGu+5wZLkHK8kEqNG/7kbLhKZYgoKahJO0HTj4Fmt17RMHDrlGoH6kZjJAsNZ/ky7iwxZVbj2hgAk8bU5Vtf1OX1fIMOrgXSuEnFoaprCZkY990W8R/1c1xt4XDtW/maYYaYnDjpTsYa9DVyiIJwYsX6jys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z7SNscdH; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z7SNscdH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D89F1F000E9; Fri, 7 Aug 2026 13:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786108756; bh=qOBJIJnNOMCdQ6+XqylCC6XKFDNzzWzFZKu0gFClous=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Z7SNscdHWB1cDQ5+rvz5nK5wNgdW3DLxKgPjQcHmsQ4QpVvOuMNdNrnRJKJGnfaQ0 jasDVQYfcu8CwGl3t+j3F4er/0YkaXao9MC2tebSSNpbJU0Q9TCGC3Rdbxyk/Xs37N o0ilVBDrpJ3rnEuINi6nda+N8KppMoO5IjIUQm8+J1VcZAoOVFgAN9cBmYXKGdKND0 MC1MEWhoPjwkZnx1k0NJIIPtvVTJEjgf2Zao9jVb4ke+z0qgJ+eNI+qhMvQ/qVUFr/ Egs5mr8oGPxMs212uYr4hHvEmY7GvWAXxzmYVBzc5I0oR1gK0+U+0dgD/3Wt9oGGUS KgFSycowVhL1Q== Date: Fri, 7 Aug 2026 14:19:11 +0100 From: Will Deacon To: Marco Elver Cc: "Paul E. McKenney" , dvyukov@google.com, Mark Rutland , Catalin Marinas , Jinjie Ruan , Ada Couprie Diaz , linux-arm-kernel@lists.infradead.org, "Peter Zijlstra (Intel)" , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Subject: Re: [PATCH RFC] arm64: Mark set_preempt_need_resched() access to .need_resched Message-ID: References: <13df4ff4-8594-4c37-b25f-860248a222cf@paulmck-laptop> <4fa802e7-6cfc-4cce-afee-c29b28171ad3@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Marco, Thanks for the help. On Fri, Aug 07, 2026 at 02:21:39PM +0200, Marco Elver wrote: > On Fri, 7 Aug 2026 at 14:06, Will Deacon wrote: > > On Thu, Aug 06, 2026 at 10:25:37AM -0700, Paul E. McKenney wrote: > > > On Thu, Aug 06, 2026 at 12:58:40PM +0100, Will Deacon wrote: > > > > On Fri, Jul 31, 2026 at 11:39:14AM -0700, Paul E. McKenney wrote: > > > > > [ 738.696166] BUG: KCSAN: data-race in __delay / set_need_resched_current > > > > > [ 738.696184] > > > > > [ 738.696188] read (marked) to 0xffff000005899b48 of 8 bytes by interrupt on cpu 8: > > > > > [ 738.696198] __delay+0xb0/0x378 > > > > > [ 738.696212] __udelay+0x4c/0x60 > > > > > [ 738.696225] kcsan_setup_watchpoint+0x3b4/0x820 > > > > > [ 738.696238] __tsan_unaligned_write4+0x228/0x26c > > > > > [ 738.696249] set_need_resched_current+0x138/0x1a8 > > > > > [ 738.696260] rcu_exp_handler+0x418/0x4a0 > > > > > [ 738.696273] __flush_smp_call_function_queue+0x36c/0x4a0 > > > > > [ 738.696288] generic_smp_call_function_single_interrupt+0x20/0x30 > > > > > > > > This is a bit weird -- it looks like the read is occuring from within > > > > kcsan itself? > > > > > > Ah, you are right, as part of KCSAN's software watchpoints. > > > > > > What do you suggest? > > > > I suppose we could add some __no_kcsan annotations to everything that is > > called from the KCSAN implementation but it feels error-prone and could > > hide races exposed by other callers. > > > > I've added the KCSAN folks to see if they have any other ideas; it looks > > like the sort of thing you'd expect them to have encountered already. > > Most of KCSAN's internals are not instrumented, but do call out to > some instrumented bits where that's safe. In this case, it looks like > a real data race, even though the access comes from __delay that was > called by KCSAN, I don't think it's any less valid. Ok, but then I don't understand how these accesses can race. They appear to be on the same CPU, in the same IPI handler. Will