Early 4.3 versions of gcc apparently aggressively optimize the raw time accumulation loop, replacing it with a divide. On 32bit systems, this causes the following link errors: undefined reference to `__umoddi3' undefined reference to `__udivdi3' The gcc issue has been fixed in 4.4 and greater. This patch replaces the accumulation loop with a do_div, as suggested by Linus.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -710,9 +710,10 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) · 709 unmodified lines | ||
| 710 | 710 | /* Accumulate raw time */ |
| 711 | 711 | raw_nsecs = timekeeper.raw_interval << shift; |
| 712 | 712 | raw_nsecs += raw_time.tv_nsec; |
| 713 | − while (raw_nsecs >= NSEC_PER_SEC) { | |
| 714 | − raw_nsecs -= NSEC_PER_SEC; | |
| 715 | − raw_time.tv_sec++; | |
| 713 | + if (raw_nsecs >= NSEC_PER_SEC) { | |
| 714 | + u64 raw_secs = raw_nsecs; | |
| 715 | + raw_nsecs = do_div(raw_secs, NSEC_PER_SEC); | |
| 716 | + raw_time.tv_sec += raw_secs; | |
| 716 | 717 | } |
| 717 | 718 | raw_time.tv_nsec = raw_nsecs; |
| 718 | 719 | |