linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Elver <elver@google.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Will Deacon <will@kernel.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [patch 0/3] tick: Annotate and document the intentionaly racy tick_do_timer_cpu
Date: Mon, 7 Dec 2020 12:05:18 +0100	[thread overview]
Message-ID: <CANpmjNPh1dhTmsBY7LCaL73wiYFLNMG9Cm5S12D38NEuRsXKGg@mail.gmail.com> (raw)
In-Reply-To: <20201206211253.919834182@linutronix.de>

On Sun, 6 Dec 2020 at 22:21, Thomas Gleixner <tglx@linutronix.de> wrote:
> There have been several reports about KCSAN complaints vs. the racy access
> to tick_do_timer_cpu. The syzbot moderation queue has three different
> patterns all related to this. There are a few more...
>
> As I know that this is intentional and safe, I did not pay much attention
> to it, but Marco actually made me feel bad a few days ago as he explained
> that these intentional races generate too much noise to get to the
> dangerous ones.

My strategy so far was to inspect random data races and decide which
ones might be more interesting and send those, but I haven't had time
to chase data races the past few months. Thus, getting rid of the
intentional boring ones will definitely scale better -- relying on a
human to do filtering really is suboptimal. :-)

> There was an earlier attempt to just silence KCSAN by slapping READ/WRITE
> once all over the place without even the faintiest attempt of reasoning,
> which is definitely the wrong thing to do.
>
> The bad thing about tick_do_timer_cpu is that its only barely documented
> why it is safe and works at all, which makes it extremly hard for someone
> not really familiar with the code to come up with reasoning.
>
> So Marco made me fast forward that item in my todo list and I have to admit
> that it would have been damned helpful if that Gleixner dude would have
> added proper comments in the first place. Would have spared a lot of brain
> twisting. :)
>
> Staring at all usage sites unearthed a few silly things which are cleaned
> up upfront. The actual annotation uses data_race() with proper comments as
> READ/WRITE_ONCE() does not really buy anything under the assumption that
> the compiler does not play silly buggers and tears the 32bit stores/loads
> into byte wise ones. But even that would cause just potentially shorter
> idle sleeps in the worst case and not a complete malfunction.

Ack -- thanks for marking the accesses!

Thanks,
-- Marco

      parent reply	other threads:[~2020-12-07 11:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06 21:12 [patch 0/3] tick: Annotate and document the intentionaly racy tick_do_timer_cpu Thomas Gleixner
2020-12-06 21:12 ` [patch 1/3] tick: Remove pointless cpu valid check in hotplug code Thomas Gleixner
2020-12-07 11:59   ` Peter Zijlstra
2020-12-07 17:44     ` Thomas Gleixner
2020-12-11 22:21   ` Frederic Weisbecker
2020-12-12  0:16     ` Thomas Gleixner
2020-12-12  1:20       ` Frederic Weisbecker
2020-12-11 22:31   ` Frederic Weisbecker
2020-12-16 10:50   ` [tip: timers/urgent] " tip-bot2 for Thomas Gleixner
2020-12-06 21:12 ` [patch 2/3] tick/sched: Remove bogus boot "safety" check Thomas Gleixner
2020-12-11 22:41   ` Frederic Weisbecker
2020-12-16 10:50   ` [tip: timers/urgent] " tip-bot2 for Thomas Gleixner
2020-12-06 21:12 ` [patch 3/3] tick: Annotate tick_do_timer_cpu data races Thomas Gleixner
2020-12-07 12:09   ` Peter Zijlstra
2020-12-07 17:46     ` Thomas Gleixner
2020-12-07 18:19       ` Marco Elver
2020-12-07 19:43         ` Thomas Gleixner
2020-12-07 19:44         ` Paul E. McKenney
2020-12-07 21:46           ` Thomas Gleixner
2020-12-07 22:38             ` Paul E. McKenney
2020-12-07 22:46               ` Thomas Gleixner
2020-12-07 22:55                 ` Paul E. McKenney
2020-12-08  8:11           ` Peter Zijlstra
2020-12-08 15:03             ` Paul E. McKenney
2020-12-16  0:27               ` Thomas Gleixner
2020-12-16 21:19                 ` Paul E. McKenney
2020-12-16 21:23                   ` Thomas Gleixner
2020-12-16 21:32                     ` Paul E. McKenney
2020-12-17 10:48                   ` Peter Zijlstra
2020-12-17 14:59                     ` Paul E. McKenney
2020-12-08  8:01         ` Peter Zijlstra
2020-12-07 11:05 ` Marco Elver [this message]

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=CANpmjNPh1dhTmsBY7LCaL73wiYFLNMG9Cm5S12D38NEuRsXKGg@mail.gmail.com \
    --to=elver@google.com \
    --cc=dvyukov@google.com \
    --cc=frederic@kernel.org \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).