Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Marco Elver <elver@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Peter Zijlstra \(Intel\)" <peterz@infradead.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Jinjie Ruan <ruanjinjie@huawei.com>,
	linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com,
	linux-arm-kernel@lists.infradead.org, dvyukov@google.com
Subject: Re: [PATCH RFC] arm64: Mark set_preempt_need_resched() access to .need_resched
Date: Fri, 7 Aug 2026 14:19:11 +0100	[thread overview]
Message-ID: <anXbTwhaWZCIxxTg@willie-the-truck> (raw)
In-Reply-To: <CANpmjNPCM0NV1EN2pNBf3EBBk8eLjbGGAiZ_+rJkoROJtG3jFQ@mail.gmail.com>

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 <will@kernel.org> 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


  reply	other threads:[~2026-08-07 13:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 23:59 [PATCH RFC] arm64: Mark set_preempt_need_resched() access to .need_resched Paul E. McKenney
2026-07-31 12:51 ` Mark Rutland
2026-07-31 16:44   ` Paul E. McKenney
2026-07-31 18:39     ` Paul E. McKenney
2026-08-06 11:58       ` Will Deacon
2026-08-06 17:25         ` Paul E. McKenney
2026-08-07 12:06           ` Will Deacon
2026-08-07 12:21             ` Marco Elver
2026-08-07 13:19               ` Will Deacon [this message]
2026-08-07 13:45                 ` Marco Elver
2026-08-07 18:44                   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=anXbTwhaWZCIxxTg@willie-the-truck \
    --to=will@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ruanjinjie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox