kernels/linux-2.4.0/arch/i386/kernel/apic.c
/*
 * Local timer interrupt handler. It does both profiling and
 * process statistics/rescheduling.
 *
 * We do profiling in every local tick, statistics/rescheduling
 * happen only every 'profiling multiplier' ticks. The default
 * multiplier is 1 and it can be changed by writing the new multiplier
 * value into /proc/profile.
 */
Local timer interrupt handler. It does both profiling and
process statistics/rescheduling.

We do profiling in every local tick, statistics/rescheduling
happen only every 'profiling multiplier' ticks. The default
multiplier is 1 and it can be changed by writing the new multiplier
value into /proc/profile.
Local timer interrupt handler . It does both profiling and process statistics / rescheduling . We do profiling in every local tick statistics / rescheduling happen only every ' profiling multiplier ' ticks . The default multiplier is 1 and it can be changed by writing the new multiplier value into / proc / profile .
inline void smp_local_timer_interrupt(struct pt_regs * regs)
{
	int user = user_mode(regs);
	int cpu = smp_processor_id();
	if (!user)
		x86_do_profile(regs->eip);
	if (--prof_counter[cpu] <= 0) {
		prof_counter[cpu] = prof_multiplier[cpu];
		if (prof_counter[cpu] != prof_old_multiplier[cpu]) {
			__setup_APIC_LVTT(calibration_result/prof_counter[cpu]);
			prof_old_multiplier[cpu] = prof_counter[cpu];
		}
#ifdef CONFIG_SMP
		update_process_times(user);
#endif
	}
}
inline void smp_local_timer_interrupt ( struct pt_regs * regs ) { int user = user_mode ( regs ) ; int cpu = smp_processor_id ( ) ; if ( ! user ) x86_do_profile ( regs -> eip ) ; if ( -- prof_counter [ cpu ] <= 0 ) { prof_counter [ cpu ] = prof_multiplier [ cpu ] ; if ( prof_counter [ cpu ] != prof_old_multiplier [ cpu ] ) { __setup_APIC_LVTT ( calibration_result / prof_counter [ cpu ] ) ; prof_old_multiplier [ cpu ] = prof_counter [ cpu ] ; } #ifdef CONFIG_SMP update_process_times ( user ) ; #endif } }
Local timer interrupt handler.
Local timer interrupt handler .
/*
	 * The profiling function is SMP safe. (nothing can mess
	 * around with "current", and the profiling counters are
	 * updated with atomic operations). This is especially
	 * useful with a profiling multiplier != 1
	 */ /*
		 * The multiplier may have changed since the last time we got
		 * to this point as a result of the user writing to
		 * /proc/profile. In this case we need to adjust the APIC
		 * timer accordingly.
		 *
		 * Interrupts are already masked off at this point.
		 */ /*
	 * We take the 'long' return path, and there every subsystem
	 * grabs the apropriate locks (kernel lock/ irq lock).
	 *
	 * we might want to decouple profiling from the 'long path',
	 * and do the profiling totally in assembly.
	 *
	 * Currently this isn't too much of an issue (performance wise),
	 * we can take more than 100K local irqs per second on a 100 MHz P5.
	 */