Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys hardclock_ticks -> getticks()
details: https://anonhg.NetBSD.org/src/rev/1a5c758c4332
branches: trunk
changeset: 930761:1a5c758c4332
user: maxv <maxv%NetBSD.org@localhost>
date: Mon Apr 13 15:54:45 2020 +0000
description:
hardclock_ticks -> getticks()
diffstat:
sys/kern/kern_condvar.c | 16 ++++++++--------
sys/kern/kern_runq.c | 16 ++++++++--------
sys/kern/kern_sleepq.c | 8 ++++----
sys/kern/kern_timeout.c | 6 +++---
sys/kern/sched_m2.c | 6 +++---
sys/kern/vfs_mount.c | 8 ++++----
sys/kern/vfs_vnode.c | 12 ++++++------
sys/netinet/tcp_usrreq.c | 6 +++---
sys/uvm/uvm_pdaemon.c | 8 ++++----
9 files changed, 43 insertions(+), 43 deletions(-)
diffs (truncated from 350 to 300 lines):
diff -r ad22889835f0 -r 1a5c758c4332 sys/kern/kern_condvar.c
--- a/sys/kern/kern_condvar.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/kern/kern_condvar.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_condvar.c,v 1.45 2020/04/10 17:16:21 ad Exp $ */
+/* $NetBSD: kern_condvar.c,v 1.46 2020/04/13 15:54:45 maxv Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.45 2020/04/10 17:16:21 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.46 2020/04/13 15:54:45 maxv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -340,13 +340,13 @@
KASSERTMSG(epsilon != NULL, "specify maximum requested delay");
/*
- * hardclock_ticks is technically int, but nothing special
+ * getticks() is technically int, but nothing special
* happens instead of overflow, so we assume two's-complement
* wraparound and just treat it as unsigned.
*/
- start = hardclock_ticks;
+ start = getticks();
error = cv_timedwait(cv, mtx, bintime2timo(bt));
- end = hardclock_ticks;
+ end = getticks();
slept = timo2bintime(end - start);
/* bt := bt - slept */
@@ -383,13 +383,13 @@
KASSERTMSG(epsilon != NULL, "specify maximum requested delay");
/*
- * hardclock_ticks is technically int, but nothing special
+ * getticks() is technically int, but nothing special
* happens instead of overflow, so we assume two's-complement
* wraparound and just treat it as unsigned.
*/
- start = hardclock_ticks;
+ start = getticks();
error = cv_timedwait_sig(cv, mtx, bintime2timo(bt));
- end = hardclock_ticks;
+ end = getticks();
slept = timo2bintime(end - start);
/* bt := bt - slept */
diff -r ad22889835f0 -r 1a5c758c4332 sys/kern/kern_runq.c
--- a/sys/kern/kern_runq.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/kern/kern_runq.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_runq.c,v 1.65 2020/04/04 20:17:58 ad Exp $ */
+/* $NetBSD: kern_runq.c,v 1.66 2020/04/13 15:54:45 maxv Exp $ */
/*-
* Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.65 2020/04/04 20:17:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.66 2020/04/13 15:54:45 maxv Exp $");
#include "opt_dtrace.h"
@@ -417,7 +417,7 @@
if (__predict_false(l->l_slptime != 0 || l->l_rticks == 0))
return false;
- return (hardclock_ticks - l->l_rticks < mstohz(cacheht_time));
+ return (getticks() - l->l_rticks < mstohz(cacheht_time));
}
/*
@@ -840,10 +840,10 @@
* XXX Should probably look at 2nd class CPUs first, but they will
* shed jobs via preempt() anyway.
*/
- if (spc->spc_nextskim > hardclock_ticks) {
+ if (spc->spc_nextskim > getticks()) {
return;
}
- spc->spc_nextskim = hardclock_ticks + mstohz(skim_interval);
+ spc->spc_nextskim = getticks() + mstohz(skim_interval);
/* In the outer loop scroll through all CPU packages, starting here. */
first = ci->ci_package1st;
@@ -1057,7 +1057,7 @@
/* Update the last run time on switch */
l = curlwp;
- l->l_rticksum += (hardclock_ticks - l->l_rticks);
+ l->l_rticksum += (getticks() - l->l_rticks);
/* Return to idle LWP if there is a migrating thread */
spc = &ci->ci_schedstate;
@@ -1075,7 +1075,7 @@
KASSERT(l != NULL);
sched_oncpu(l);
- l->l_rticks = hardclock_ticks;
+ l->l_rticks = getticks();
return l;
}
@@ -1204,7 +1204,7 @@
l->l_flag, l->l_stat == LSRUN ? "RQ" :
(l->l_stat == LSSLEEP ? "SQ" : "-"),
l, ci->ci_index, (tci ? tci->ci_index : -1),
- (u_int)(hardclock_ticks - l->l_rticks));
+ (u_int)(getticks() - l->l_rticks));
}
}
}
diff -r ad22889835f0 -r 1a5c758c4332 sys/kern/kern_sleepq.c
--- a/sys/kern/kern_sleepq.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/kern/kern_sleepq.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sleepq.c,v 1.64 2020/04/10 17:16:21 ad Exp $ */
+/* $NetBSD: kern_sleepq.c,v 1.65 2020/04/13 15:54:45 maxv Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008, 2009, 2019, 2020 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.64 2020/04/10 17:16:21 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.65 2020/04/13 15:54:45 maxv Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -151,7 +151,7 @@
}
/* Update sleep time delta, call the wake-up handler of scheduler */
- l->l_slpticksum += (hardclock_ticks - l->l_slpticks);
+ l->l_slpticksum += (getticks() - l->l_slpticks);
sched_wakeup(l);
/* Look for a CPU to wake up */
@@ -228,7 +228,7 @@
sleepq_insert(sq, l, sobj);
/* Save the time when thread has slept */
- l->l_slpticks = hardclock_ticks;
+ l->l_slpticks = getticks();
sched_slept(l);
}
diff -r ad22889835f0 -r 1a5c758c4332 sys/kern/kern_timeout.c
--- a/sys/kern/kern_timeout.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/kern/kern_timeout.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_timeout.c,v 1.59 2020/03/21 02:32:37 ad Exp $ */
+/* $NetBSD: kern_timeout.c,v 1.60 2020/04/13 15:54:45 maxv Exp $ */
/*-
* Copyright (c) 2003, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.59 2020/03/21 02:32:37 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.60 2020/04/13 15:54:45 maxv Exp $");
/*
* Timeouts are kept in a hierarchical timing wheel. The c_time is the
@@ -839,7 +839,7 @@
int b;
#ifndef CRASH
- db_printf("hardclock_ticks now: %d\n", hardclock_ticks);
+ db_printf("hardclock_ticks now: %d\n", getticks());
#endif
db_printf(" ticks wheel arg func\n");
diff -r ad22889835f0 -r 1a5c758c4332 sys/kern/sched_m2.c
--- a/sys/kern/sched_m2.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/kern/sched_m2.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sched_m2.c,v 1.37 2019/12/06 18:33:19 ad Exp $ */
+/* $NetBSD: sched_m2.c,v 1.38 2020/04/13 15:54:45 maxv Exp $ */
/*
* Copyright (c) 2007, 2008 Mindaugas Rasiukevicius <rmind at NetBSD org>
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.37 2019/12/06 18:33:19 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.38 2020/04/13 15:54:45 maxv Exp $");
#include <sys/param.h>
@@ -255,7 +255,7 @@
/* If thread was not ran a second or more - set a high priority */
if (l->l_stat == LSRUN) {
- if (l->l_rticks && (hardclock_ticks - l->l_rticks >= hz))
+ if (l->l_rticks && (getticks() - l->l_rticks >= hz))
prio = high_pri[prio];
/* Re-enqueue the thread if priority has changed */
if (prio != l->l_priority)
diff -r ad22889835f0 -r 1a5c758c4332 sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/kern/vfs_mount.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_mount.c,v 1.76 2020/04/10 22:34:36 ad Exp $ */
+/* $NetBSD: vfs_mount.c,v 1.77 2020/04/13 15:54:45 maxv Exp $ */
/*-
* Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.76 2020/04/10 22:34:36 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.77 2020/04/13 15:54:45 maxv Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -520,9 +520,9 @@
static vnode_t *
vflushnext(struct vnode_iterator *marker, int *when)
{
- if (hardclock_ticks > *when) {
+ if (getticks() > *when) {
yield();
- *when = hardclock_ticks + hz / 10;
+ *when = getticks() + hz / 10;
}
return vfs_vnode_iterator_next1(marker, NULL, NULL, true);
}
diff -r ad22889835f0 -r 1a5c758c4332 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/kern/vfs_vnode.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.118 2020/04/04 20:54:42 ad Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.119 2020/04/13 15:54:45 maxv Exp $ */
/*-
* Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.118 2020/04/04 20:54:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.119 2020/04/13 15:54:45 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_pax.h"
@@ -483,7 +483,7 @@
*/
vip = VNODE_TO_VIMPL(vp);
if (listhd == vip->vi_lrulisthd &&
- (hardclock_ticks - vip->vi_lrulisttm) < hz) {
+ (getticks() - vip->vi_lrulisttm) < hz) {
return;
}
@@ -494,7 +494,7 @@
else
d++;
vip->vi_lrulisthd = listhd;
- vip->vi_lrulisttm = hardclock_ticks;
+ vip->vi_lrulisttm = getticks();
if (vip->vi_lrulisthd != NULL)
TAILQ_INSERT_TAIL(vip->vi_lrulisthd, vip, vi_lrulist);
else
@@ -540,7 +540,7 @@
KASSERT(vip->vi_lrulisthd == &lru_list[LRU_VRELE]);
TAILQ_REMOVE(vip->vi_lrulisthd, vip, vi_lrulist);
vip->vi_lrulisthd = &lru_list[LRU_HOLD];
- vip->vi_lrulisttm = hardclock_ticks;
+ vip->vi_lrulisttm = getticks();
TAILQ_INSERT_TAIL(vip->vi_lrulisthd, vip, vi_lrulist);
mutex_exit(&vdrain_lock);
@@ -622,7 +622,7 @@
KASSERT(vip->vi_lrulisthd == &lru_list[LRU_VRELE]);
TAILQ_REMOVE(vip->vi_lrulisthd, vip, vi_lrulist);
vip->vi_lrulisthd = &lru_list[LRU_HOLD];
- vip->vi_lrulisttm = hardclock_ticks;
+ vip->vi_lrulisttm = getticks();
TAILQ_INSERT_TAIL(vip->vi_lrulisthd, vip, vi_lrulist);
vdrain_retry = true;
diff -r ad22889835f0 -r 1a5c758c4332 sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c Mon Apr 13 15:48:55 2020 +0000
+++ b/sys/netinet/tcp_usrreq.c Mon Apr 13 15:54:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.225 2019/08/06 15:48:18 riastradh Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.226 2020/04/13 15:54:45 maxv Exp $ */
Home |
Main Index |
Thread Index |
Old Index