Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern heartbeat(9): For now, use time_uptime without atom...
details: https://anonhg.NetBSD.org/src/rev/0bcd7214b9be
branches: trunk
changeset: 377537:0bcd7214b9be
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Jul 16 10:18:19 2023 +0000
description:
heartbeat(9): For now, use time_uptime without atomic_load_relaxed.
A later commit will change time_uptime to a macro so it is atomic,
using atomc_load_relaxed if possible or seqlock if not.
diffstat:
sys/kern/kern_heartbeat.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (45 lines):
diff -r fea334b7efb1 -r 0bcd7214b9be sys/kern/kern_heartbeat.c
--- a/sys/kern/kern_heartbeat.c Sun Jul 16 10:18:07 2023 +0000
+++ b/sys/kern/kern_heartbeat.c Sun Jul 16 10:18:19 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_heartbeat.c,v 1.4 2023/07/16 10:18:07 riastradh Exp $ */
+/* $NetBSD: kern_heartbeat.c,v 1.5 2023/07/16 10:18:19 riastradh Exp $ */
/*-
* Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_heartbeat.c,v 1.4 2023/07/16 10:18:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_heartbeat.c,v 1.5 2023/07/16 10:18:19 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -157,7 +157,7 @@ heartbeat_resume_cpu(struct cpu_info *ci
KASSERT(__predict_false(cold) || ci == curcpu());
ci->ci_heartbeat_count = 0;
- ci->ci_heartbeat_uptime_cache = atomic_load_relaxed(&time_uptime);
+ ci->ci_heartbeat_uptime_cache = time_uptime;
ci->ci_heartbeat_uptime_stamp = 0;
}
@@ -352,7 +352,7 @@ static void
heartbeat_intr(void *cookie)
{
unsigned count = atomic_load_relaxed(&curcpu()->ci_heartbeat_count);
- unsigned uptime = atomic_load_relaxed(&time_uptime);
+ unsigned uptime = time_uptime;
atomic_store_relaxed(&curcpu()->ci_heartbeat_uptime_stamp, count);
atomic_store_relaxed(&curcpu()->ci_heartbeat_uptime_cache, uptime);
@@ -579,7 +579,7 @@ heartbeat(void)
* changed, and stop here -- we only do the cross-CPU work once
* per second.
*/
- uptime = atomic_load_relaxed(&time_uptime);
+ uptime = time_uptime;
cache = atomic_load_relaxed(&curcpu()->ci_heartbeat_uptime_cache);
if (__predict_true(cache == uptime)) {
/*
Home |
Main Index |
Thread Index |
Old Index