Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aabd67d authored by Torben Hohn's avatar Torben Hohn Committed by Thomas Gleixner
Browse files

ia64: Switch do_timer() to xtime_update()



local_cpu_data->itm_next = new_itm; does not need to be protected by
xtime_lock. xtime_update() takes the lock itself.

Signed-off-by: default avatarTorben Hohn <torbenh@gmx.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: johnstul@us.ibm.com
Cc: hch@infradead.org
Cc: yong.zhang0@gmail.com
LKML-Reference: <20110127145956.23248.49107.stgit@localhost>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent daad8b58
Loading
Loading
Loading
Loading
+5 −14
Original line number Original line Diff line number Diff line
@@ -190,18 +190,9 @@ timer_interrupt (int irq, void *dev_id)


		new_itm += local_cpu_data->itm_delta;
		new_itm += local_cpu_data->itm_delta;


		if (smp_processor_id() == time_keeper_id) {
		if (smp_processor_id() == time_keeper_id)
			/*
			xtime_update(1);
			 * Here we are in the timer irq handler. We have irqs locally

			 * disabled, but we don't know if the timer_bh is running on
			 * another CPU. We need to avoid to SMP race by acquiring the
			 * xtime_lock.
			 */
			write_seqlock(&xtime_lock);
			do_timer(1);
			local_cpu_data->itm_next = new_itm;
			write_sequnlock(&xtime_lock);
		} else
		local_cpu_data->itm_next = new_itm;
		local_cpu_data->itm_next = new_itm;


		if (time_after(new_itm, ia64_get_itc()))
		if (time_after(new_itm, ia64_get_itc()))
@@ -222,7 +213,7 @@ timer_interrupt (int irq, void *dev_id)
		 * comfort, we increase the safety margin by
		 * comfort, we increase the safety margin by
		 * intentionally dropping the next tick(s).  We do NOT
		 * intentionally dropping the next tick(s).  We do NOT
		 * update itm.next because that would force us to call
		 * update itm.next because that would force us to call
		 * do_timer() which in turn would let our clock run
		 * xtime_update() which in turn would let our clock run
		 * too fast (with the potentially devastating effect
		 * too fast (with the potentially devastating effect
		 * of losing monotony of time).
		 * of losing monotony of time).
		 */
		 */
+5 −8
Original line number Original line Diff line number Diff line
@@ -139,14 +139,11 @@ consider_steal_time(unsigned long new_itm)
		run_posix_cpu_timers(p);
		run_posix_cpu_timers(p);
		delta_itm += local_cpu_data->itm_delta * (stolen + blocked);
		delta_itm += local_cpu_data->itm_delta * (stolen + blocked);


		if (cpu == time_keeper_id) {
		if (cpu == time_keeper_id)
			write_seqlock(&xtime_lock);
			xtime_update(stolen + blocked);
			do_timer(stolen + blocked);

			local_cpu_data->itm_next = delta_itm + new_itm;
			write_sequnlock(&xtime_lock);
		} else {
		local_cpu_data->itm_next = delta_itm + new_itm;
		local_cpu_data->itm_next = delta_itm + new_itm;
		}

		per_cpu(xen_stolen_time, cpu) += NS_PER_TICK * stolen;
		per_cpu(xen_stolen_time, cpu) += NS_PER_TICK * stolen;
		per_cpu(xen_blocked_time, cpu) += NS_PER_TICK * blocked;
		per_cpu(xen_blocked_time, cpu) += NS_PER_TICK * blocked;
	}
	}