From: "tip-bot2 for Thomas Gleixner" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] timekeeping: Annotate ktime_get_boot_fast_ns() with data_race()
Date: Mon, 02 May 2022 12:04:32 -0000 [thread overview]
Message-ID: <165149307242.4207.1206001832585845014.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220415091920.956045162@linutronix.de>
The following commit has been merged into the timers/core branch of tip:
Commit-ID: eff4849f928f2b90402907e06a6de1619cf16b1a
Gitweb: https://git.kernel.org/tip/eff4849f928f2b90402907e06a6de1619cf16b1a
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Fri, 15 Apr 2022 11:19:35 +02:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 02 May 2022 14:00:20 +02:00
timekeeping: Annotate ktime_get_boot_fast_ns() with data_race()
Accessing timekeeper::offset_boot in ktime_get_boot_fast_ns() is an
intended data race as the reader side cannot synchronize with a writer and
there is no space in struct tk_read_base of the NMI safe timekeeper.
Mark it so.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220415091920.956045162@linutronix.de
---
kernel/time/timekeeping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 2c22023..3479804 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -528,7 +528,7 @@ u64 notrace ktime_get_boot_fast_ns(void)
{
struct timekeeper *tk = &tk_core.timekeeper;
- return (ktime_get_mono_fast_ns() + ktime_to_ns(tk->offs_boot));
+ return (ktime_get_mono_fast_ns() + ktime_to_ns(data_race(tk->offs_boot)));
}
EXPORT_SYMBOL_GPL(ktime_get_boot_fast_ns);
next prev parent reply other threads:[~2022-05-02 12:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-15 9:19 [patch 0/3] timekeeping: Janitorial updates Thomas Gleixner
2022-04-15 9:19 ` [patch 1/3] timekeeping: Annotate ktime_get_boot_fast_ns() with data_race() Thomas Gleixner
2022-04-15 12:07 ` Peter Zijlstra
2022-04-15 21:46 ` Thomas Gleixner
2022-05-02 12:04 ` tip-bot2 for Thomas Gleixner [this message]
2022-04-15 9:19 ` [patch 2/3] timekeeping: Mark tk_clock_read() __always_inline Thomas Gleixner
2022-04-15 12:09 ` Peter Zijlstra
2022-04-15 21:48 ` Thomas Gleixner
2022-04-15 9:19 ` [patch 3/3] timekeeping: Consolidate fast timekeeper Thomas Gleixner
2022-04-15 12:09 ` Peter Zijlstra
2022-05-02 12:04 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
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=165149307242.4207.1206001832585845014.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@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®