svn commit: r232717 - head/sys/kern

Alexander Motin mav at FreeBSD.org
Fri Mar 9 07:30:48 UTC 2012


Author: mav
Date: Fri Mar  9 07:30:48 2012
New Revision: 232717
URL: http://svn.freebsd.org/changeset/base/232717

Log:
  Be more polite when setting state->nextevent inside cpu_new_callout().
  Hardclock is not the only who wakes idle CPU since kdtrace cyclic addition.
  
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_clocksource.c

Modified: head/sys/kern/kern_clocksource.c
==============================================================================
--- head/sys/kern/kern_clocksource.c	Fri Mar  9 05:43:08 2012	(r232716)
+++ head/sys/kern/kern_clocksource.c	Fri Mar  9 07:30:48 2012	(r232717)
@@ -854,10 +854,11 @@ cpu_new_callout(int cpu, int ticks)
 	 * If timer is global - there is chance it is already programmed.
 	 */
 	if (periodic || (timer->et_flags & ET_FLAGS_PERCPU) == 0) {
-		state->nextevent = state->nexthard;
 		tmp = hardperiod;
 		bintime_mul(&tmp, ticks - 1);
-		bintime_add(&state->nextevent, &tmp);
+		bintime_add(&tmp, &state->nexthard);
+		if (bintime_cmp(&tmp, &state->nextevent, <))
+			state->nextevent = tmp;
 		if (periodic ||
 		    bintime_cmp(&state->nextevent, &nexttick, >=)) {
 			ET_HW_UNLOCK(state);


More information about the svn-src-all mailing list