Date: Fri, 9 Mar 2012 07:30:48 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r232717 - head/sys/kern Message-ID: <201203090730.q297UmYb085024@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203090730.q297UmYb085024>