mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Jaidev Shastri via B4 Relay
	<devnull+jaidevshastri.vt.edu@kernel.org>,
	John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>,
	Miroslav Lichvar <mlichvar@redhat.com>
Cc: linux-kernel@vger.kernel.org, Jaidev Shastri <jaidevshastri@vt.edu>
Subject: Re: [PATCH] timekeeping: publish suspend_timing_needed with release semantics
Date: Tue, 29 Sep 2026 14:05:07 +0200	[thread overview]
Message-ID: <87tsn8i7po.ffs@fw13> (raw)
In-Reply-To: <20260921-mb-timekeeping-v1-1-282f1f4121ed@vt.edu>

On Mon, Sep 21 2026 at 21:23, Jaidev Shastri via wrote:
> From: Jaidev Shastri <jaidevshastri@vt.edu>
>
> timekeeping_suspend() sets suspend_timing_needed with a plain store
> after it has read the persistent clock. timekeeping_rtc_skipresume()
> reads it with a plain load on behalf of the RTC class during resume.

> Set it with smp_store_release() and read it with smp_load_acquire().
>
> Found with MBCheck, a static herd7-based memory consistency checker.

And what exactly is this release/acquire solving?

1) timekeeping_suspend()
        suspend_timing_needed = true
   ...

2) system suspends

3) system resumes

4) timekeeping_resume()
        if (inject_sleeptime)
            suspend_timing_needed = false

5) system continues to resume

6) timekeeping_rtc_skipresume()

The store in #1 is completely uninteresting because suspend/resume is a big
pile of memory barriers so there is _ZERO_ chance that #6 cannot observe
the store in #1.

The more interesting case would be the conditional store in #4 which in
a pretty far fetched theory could lead to the case that
timekeeping_rtc_skipresume() would not observe it.

But if you actually look at the sequence which is between #4 and #6 this
theory becomes a myth.

Please analyze your tool findings properly before blindly claiming that
the tool actually found something problematic.

Thanks,

        tglx

      reply	other threads:[~2026-09-29 12:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  1:23 Jaidev Shastri via B4 Relay
2026-09-29 12:05 ` Thomas Gleixner [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=87tsn8i7po.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=devnull+jaidevshastri.vt.edu@kernel.org \
    --cc=jaidevshastri@vt.edu \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=sboyd@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

all inboxes | Powered by JetHome®