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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to