Author: mav
Date: Fri Mar 23 16:12:52 2012
New Revision: 233367
URL: http://svn.freebsd.org/changeset/base/233367

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

Modified:
  stable/9/sys/kern/kern_clocksource.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_clocksource.c
==============================================================================
--- stable/9/sys/kern/kern_clocksource.c        Fri Mar 23 15:49:46 2012        
(r233366)
+++ stable/9/sys/kern/kern_clocksource.c        Fri Mar 23 16:12:52 2012        
(r233367)
@@ -860,10 +860,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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to