The patch titled Time: optimize out some mults, since gcc can't avoid them has been removed from the -mm tree. Its filename is time-use-clocksource-abstraction-for-ntp-adjustments-optimize-out-some-mults-since-gcc-cant-avoid-them.patch This patch was dropped because it was folded into time-use-clocksource-abstraction-for-ntp-adjustments.patch ------------------------------------------------------ Subject: Time: optimize out some mults, since gcc can't avoid them From: john stultz <johnstul@xxxxxxxxxx> Newsflash: GCC not as smart as once hoped. This patch removes some mults since GCC can't figure out how. Pointed out by Roman Zippel. Signed-off-by: John Stultz <johnstul@xxxxxxxxxx> Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/clocksource.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff -puN include/linux/clocksource.h~time-use-clocksource-abstraction-for-ntp-adjustments-optimize-out-some-mults-since-gcc-cant-avoid-them include/linux/clocksource.h --- a/include/linux/clocksource.h~time-use-clocksource-abstraction-for-ntp-adjustments-optimize-out-some-mults-since-gcc-cant-avoid-them +++ a/include/linux/clocksource.h @@ -236,7 +236,6 @@ static inline int error_aproximation(u64 * * Where mult_delta is the adjustment value made to mult * - * XXX - Hopefully gcc is smart enough to avoid the multiplies. */ static inline s64 make_ntp_adj(struct clocksource *clock, cycles_t cycles_delta, s64* error) @@ -244,27 +243,27 @@ static inline s64 make_ntp_adj(struct cl s64 ret = 0; if (*error > ((s64)clock->interval_cycles+1)/2) { /* calculate adjustment value */ - int adjustment = 1 << error_aproximation(*error, + int adjustment = error_aproximation(*error, clock->interval_cycles); /* adjust clock */ - clock->mult += adjustment; - clock->interval_snsecs += clock->interval_cycles * adjustment; + clock->mult += 1 << adjustment; + clock->interval_snsecs += clock->interval_cycles << adjustment; /* adjust the base and error for the adjustment */ - ret = -(cycles_delta * adjustment); - *error -= clock->interval_cycles * adjustment; + ret = -(cycles_delta << adjustment); + *error -= clock->interval_cycles << adjustment; /* XXX adj error for cycle_delta offset? */ } else if ((-(*error)) > ((s64)clock->interval_cycles+1)/2) { /* calculate adjustment value */ - int adjustment = 1 << error_aproximation(-(*error), + int adjustment = error_aproximation(-(*error), clock->interval_cycles); /* adjust clock */ - clock->mult -= adjustment; - clock->interval_snsecs -= clock->interval_cycles * adjustment; + clock->mult -= 1 << adjustment; + clock->interval_snsecs -= clock->interval_cycles << adjustment; /* adjust the base and error for the adjustment */ - ret = cycles_delta * adjustment; - *error += clock->interval_cycles * adjustment; + ret = cycles_delta << adjustment; + *error += clock->interval_cycles << adjustment; /* XXX adj error for cycle_delta offset? */ } return ret; _ Patches currently in -mm which might be from johnstul@xxxxxxxxxx are time-clocksource-infrastructure.patch time-use-clocksource-infrastructure-for-update_wall_time.patch time-let-user-request-precision-from-current_tick_length.patch time-use-clocksource-abstraction-for-ntp-adjustments.patch time-use-clocksource-abstraction-for-ntp-adjustments-optimize-out-some-mults-since-gcc-cant-avoid-them.patch time-introduce-arch-generic-time-accessors.patch hangcheck-remove-monotomic_clock-on-x86.patch time-i386-conversion-part-1-move-timer_pitc-to-i8253c.patch time-i386-conversion-part-2-rework-tsc-support.patch time-i386-conversion-part-3-enable-generic-timekeeping.patch time-i386-conversion-part-4-remove-old-timer_opts-code.patch time-i386-clocksource-drivers.patch time-i386-clocksource-drivers-pm-timer-doesnt-use-workaround-if-chipset-is-not-buggy.patch time-i386-clocksource-drivers-pm-timer-doesnt-use-workaround-if-chipset-is-not-buggy-acpi_pm-cleanup.patch time-i386-clocksource-drivers-pm-timer-doesnt-use-workaround-if-chipset-is-not-buggy-acpi_pm-cleanup-fix-missing-to-rename-pmtmr_good-to-acpi_pm_good.patch time-i386-clocksource-drivers-fix-spelling-typos.patch time-rename-clocksource-functions.patch make-pmtmr_ioport-__read_mostly.patch generic-time-add-macro-to-simplify-hide-mask.patch time-fix-time-going-backward-w-clock=pit.patch fix-and-optimize-clock-source-update.patch gtod-add-scx200-hrt-clocksourcediff.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html