Skip to content

Commit e147ec8

Browse files
willschmpaulusmack
authored andcommitted
[POWERPC] Simplify smp_space_timers
Greatly simplify the function smp_space_timers. The stolen time calculation (per comment within the code) doesn't need the half-jiffy stagger any more. There isn't an issue with bouncing off global locks, so we really shouldn't need any sort of staggering at all. However, the last_jiffy value still needs to be set. This removes the extra stagger logic, and just sets the values. This change should benefit applications that rely on barrier synchronization, and will help cut down OS jitter. Boot tested across the board (G5,power3,power4,power5,970mp blade). Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 435e0b2 commit e147ec8

1 file changed

Lines changed: 2 additions & 17 deletions

File tree

‎arch/powerpc/kernel/time.c‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -711,30 +711,15 @@ void wakeup_decrementer(void)
711711
void __init smp_space_timers(unsigned int max_cpus)
712712
{
713713
int i;
714-
unsigned long half = tb_ticks_per_jiffy / 2;
715-
unsigned long offset = tb_ticks_per_jiffy / max_cpus;
716714
u64 previous_tb = per_cpu(last_jiffy, boot_cpuid);
717715

718716
/* make sure tb > per_cpu(last_jiffy, cpu) for all cpus always */
719717
previous_tb -= tb_ticks_per_jiffy;
720-
/*
721-
* The stolen time calculation for POWER5 shared-processor LPAR
722-
* systems works better if the two threads' timebase interrupts
723-
* are staggered by half a jiffy with respect to each other.
724-
*/
718+
725719
for_each_possible_cpu(i) {
726720
if (i == boot_cpuid)
727721
continue;
728-
if (i == (boot_cpuid ^ 1))
729-
per_cpu(last_jiffy, i) =
730-
per_cpu(last_jiffy, boot_cpuid) - half;
731-
else if (i & 1)
732-
per_cpu(last_jiffy, i) =
733-
per_cpu(last_jiffy, i ^ 1) + half;
734-
else {
735-
previous_tb += offset;
736-
per_cpu(last_jiffy, i) = previous_tb;
737-
}
722+
per_cpu(last_jiffy, i) = previous_tb;
738723
}
739724
}
740725
#endif

0 commit comments

Comments
 (0)