From: "tip-bot2 for Christophe Leroy" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Christophe Leroy <christophe.leroy@c-s.fr>,
Thomas Gleixner <tglx@linutronix.de>, x86 <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [tip: timers/core] lib/vdso: Only read hrtimer_res when needed in __cvdso_clock_getres()
Date: Thu, 16 Jan 2020 20:28:49 -0000 [thread overview]
Message-ID: <157920652995.396.11214684857545426237.tip-bot2@tip-bot2> (raw)
In-Reply-To: =?utf-8?q?=3C7ac2f0d21652f95e2bbdfa6bd514ae6c7caf53ab=2E15791?= =?utf-8?q?96675=2Egit=2Echristophe=2Eleroy=40c-s=2Efr=3E?=
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 49a101d7169c7729c7bab6b2f896faae34bd6c3d
Gitweb: https://git.kernel.org/tip/49a101d7169c7729c7bab6b2f896faae34bd6c3d
Author: Christophe Leroy <christophe.leroy@c-s.fr>
AuthorDate: Thu, 16 Jan 2020 17:58:27
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 16 Jan 2020 21:24:46 +01:00
lib/vdso: Only read hrtimer_res when needed in __cvdso_clock_getres()
Only perform READ_ONCE(vd[CS_HRES_COARSE].hrtimer_res) for
HRES and RAW clocks.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/7ac2f0d21652f95e2bbdfa6bd514ae6c7caf53ab.1579196675.git.christophe.leroy@c-s.fr
---
lib/vdso/gettimeofday.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index f342ac1..f8b8ec5 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -312,7 +312,6 @@ static __maybe_unused
int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res)
{
const struct vdso_data *vd = __arch_get_vdso_data();
- u64 hrtimer_res;
u32 msk;
u64 ns;
@@ -323,7 +322,6 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res)
if (IS_ENABLED(CONFIG_TIME_NS) && vd->clock_mode == VCLOCK_TIMENS)
vd = __arch_get_timens_vdso_data();
- hrtimer_res = READ_ONCE(vd[CS_HRES_COARSE].hrtimer_res);
/*
* Convert the clockid to a bitmask and use it to check which
* clocks are handled in the VDSO directly.
@@ -333,7 +331,7 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res)
/*
* Preserves the behaviour of posix_get_hrtimer_res().
*/
- ns = hrtimer_res;
+ ns = READ_ONCE(vd[CS_HRES_COARSE].hrtimer_res);
} else if (msk & VDSO_COARSE) {
/*
* Preserves the behaviour of posix_get_coarse_res().
reply other threads:[~2020-01-16 20:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=157920652995.396.11214684857545426237.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=christophe.leroy@c-s.fr \
--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®