Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Aug 2016 10:56:04 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r304894 - in stable/10/sys: kern sys
Message-ID:  <201608271056.u7RAu4AS004982@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Aug 27 10:56:04 2016
New Revision: 304894
URL: https://svnweb.freebsd.org/changeset/base/304894

Log:
  MFC r264388 (by davide):
  Define SBT_MAX.
  
  MFC r267896 (by davide):
  Improve r264388.
  
  MFC note.  The SBT_MAX definition already existed on stable/10, but without
  the refinement from r267896.  Also, consumers of SBT_MAX were not converted,
  since r264388 was not merged properly.
  
  Reviewed by:	mav

Modified:
  stable/10/sys/kern/kern_clocksource.c
  stable/10/sys/kern/kern_event.c
  stable/10/sys/kern/kern_timeout.c
  stable/10/sys/kern/sys_generic.c
  stable/10/sys/sys/time.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_clocksource.c
==============================================================================
--- stable/10/sys/kern/kern_clocksource.c	Sat Aug 27 10:34:01 2016	(r304893)
+++ stable/10/sys/kern/kern_clocksource.c	Sat Aug 27 10:56:04 2016	(r304894)
@@ -211,7 +211,7 @@ handleevents(sbintime_t now, int fake)
 	} else
 		state->nextprof = state->nextstat;
 	if (now >= state->nextcallopt) {
-		state->nextcall = state->nextcallopt = INT64_MAX;
+		state->nextcall = state->nextcallopt = SBT_MAX;
 		callout_process(now);
 	}
 
@@ -492,7 +492,7 @@ configtimer(int start)
 			state = DPCPU_ID_PTR(cpu, timerstate);
 			state->now = now;
 			if (!smp_started && cpu != CPU_FIRST())
-				state->nextevent = INT64_MAX;
+				state->nextevent = SBT_MAX;
 			else
 				state->nextevent = next;
 			if (periodic)
@@ -580,8 +580,8 @@ cpu_initclocks_bsp(void)
 	CPU_FOREACH(cpu) {
 		state = DPCPU_ID_PTR(cpu, timerstate);
 		mtx_init(&state->et_hw_mtx, "et_hw_mtx", NULL, MTX_SPIN);
-		state->nextcall = INT64_MAX;
-		state->nextcallopt = INT64_MAX;
+		state->nextcall = SBT_MAX;
+		state->nextcallopt = SBT_MAX;
 	}
 	periodic = want_periodic;
 	/* Grab requested timer or the best of present. */

Modified: stable/10/sys/kern/kern_event.c
==============================================================================
--- stable/10/sys/kern/kern_event.c	Sat Aug 27 10:34:01 2016	(r304893)
+++ stable/10/sys/kern/kern_event.c	Sat Aug 27 10:56:04 2016	(r304894)
@@ -1471,7 +1471,7 @@ kqueue_scan(struct kqueue *kq, int maxev
 				rsbt = tstosbt(*tsp);
 				if (TIMESEL(&asbt, rsbt))
 					asbt += tc_tick_sbt;
-				if (asbt <= INT64_MAX - rsbt)
+				if (asbt <= SBT_MAX - rsbt)
 					asbt += rsbt;
 				else
 					asbt = 0;

Modified: stable/10/sys/kern/kern_timeout.c
==============================================================================
--- stable/10/sys/kern/kern_timeout.c	Sat Aug 27 10:34:01 2016	(r304893)
+++ stable/10/sys/kern/kern_timeout.c	Sat Aug 27 10:56:04 2016	(r304894)
@@ -296,7 +296,7 @@ callout_cpu_init(struct callout_cpu *cc,
 	for (i = 0; i < callwheelsize; i++)
 		LIST_INIT(&cc->cc_callwheel[i]);
 	TAILQ_INIT(&cc->cc_expireq);
-	cc->cc_firstevent = INT64_MAX;
+	cc->cc_firstevent = SBT_MAX;
 	for (i = 0; i < 2; i++)
 		cc_cce_cleanup(cc, i);
 	snprintf(cc->cc_ktr_event_name, sizeof(cc->cc_ktr_event_name),
@@ -569,8 +569,8 @@ callout_cc_add(struct callout *c, struct
 	 * Inform the eventtimers(4) subsystem there's a new callout
 	 * that has been inserted, but only if really required.
 	 */
-	if (INT64_MAX - c->c_time < c->c_precision)
-		c->c_precision = INT64_MAX - c->c_time;
+	if (SBT_MAX - c->c_time < c->c_precision)
+		c->c_precision = SBT_MAX - c->c_time;
 	sbt = c->c_time + c->c_precision;
 	if (sbt < cc->cc_firstevent) {
 		cc->cc_firstevent = sbt;
@@ -961,8 +961,8 @@ callout_reset_sbt_on(struct callout *c, 
 				to_sbt += tick_sbt;
 		} else
 			to_sbt = sbinuptime();
-		if (INT64_MAX - to_sbt < sbt)
-			to_sbt = INT64_MAX;
+		if (SBT_MAX - to_sbt < sbt)
+			to_sbt = SBT_MAX;
 		else
 			to_sbt += sbt;
 		pr = ((C_PRELGET(flags) < 0) ? sbt >> tc_precexp :

Modified: stable/10/sys/kern/sys_generic.c
==============================================================================
--- stable/10/sys/kern/sys_generic.c	Sat Aug 27 10:34:01 2016	(r304893)
+++ stable/10/sys/kern/sys_generic.c	Sat Aug 27 10:56:04 2016	(r304894)
@@ -1089,7 +1089,7 @@ kern_select(struct thread *td, int nd, f
 			precision >>= tc_precexp;
 			if (TIMESEL(&asbt, rsbt))
 				asbt += tc_tick_sbt;
-			if (asbt <= INT64_MAX - rsbt)
+			if (asbt <= SBT_MAX - rsbt)
 				asbt += rsbt;
 			else
 				asbt = -1;
@@ -1626,7 +1626,7 @@ selsocket(struct socket *so, int events,
 			precision >>= tc_precexp;
 			if (TIMESEL(&asbt, rsbt))
 				asbt += tc_tick_sbt;
-			if (asbt <= INT64_MAX - rsbt)
+			if (asbt <= SBT_MAX - rsbt)
 				asbt += rsbt;
 			else
 				asbt = -1;

Modified: stable/10/sys/sys/time.h
==============================================================================
--- stable/10/sys/sys/time.h	Sat Aug 27 10:34:01 2016	(r304893)
+++ stable/10/sys/sys/time.h	Sat Aug 27 10:56:04 2016	(r304894)
@@ -129,7 +129,7 @@ bintime_shift(struct bintime *_bt, int _
 #define	SBT_1MS	(SBT_1S / 1000)
 #define	SBT_1US	(SBT_1S / 1000000)
 #define	SBT_1NS	(SBT_1S / 1000000000)
-#define	SBT_MAX 0x7fffffffffffffff
+#define	SBT_MAX	0x7fffffffffffffffLL
 
 static __inline int
 sbintime_getsec(sbintime_t _sbt)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608271056.u7RAu4AS004982>