<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/hrtimer.c, branch v2.6.21-rc7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.21-rc7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.21-rc7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2007-04-07T17:03:43Z</updated>
<entry>
<title>[PATCH] high-res timers: resume fix</title>
<updated>2007-04-07T17:03:43Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2007-04-07T10:05:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=995f054f2a342f8505fed4f8395d12c0f5966414'/>
<id>urn:sha1:995f054f2a342f8505fed4f8395d12c0f5966414</id>
<content type='text'>
Soeren Sonnenburg reported that upon resume he is getting
this backtrace:

 [&lt;c0119637&gt;] smp_apic_timer_interrupt+0x57/0x90
 [&lt;c0142d30&gt;] retrigger_next_event+0x0/0xb0
 [&lt;c0104d30&gt;] apic_timer_interrupt+0x28/0x30
 [&lt;c0142d30&gt;] retrigger_next_event+0x0/0xb0
 [&lt;c0140068&gt;] __kfifo_put+0x8/0x90
 [&lt;c0130fe5&gt;] on_each_cpu+0x35/0x60
 [&lt;c0143538&gt;] clock_was_set+0x18/0x20
 [&lt;c0135cdc&gt;] timekeeping_resume+0x7c/0xa0
 [&lt;c02aabe1&gt;] __sysdev_resume+0x11/0x80
 [&lt;c02ab0c7&gt;] sysdev_resume+0x47/0x80
 [&lt;c02b0b05&gt;] device_power_up+0x5/0x10

it turns out that on resume we mistakenly re-enable interrupts too
early.  Do the timer retrigger only on the current CPU.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Soeren Sonnenburg &lt;kernel@nn7.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] hrtimers: fix reprogramming SMP race</title>
<updated>2007-03-28T20:44:31Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2007-03-28T11:17:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=935c631db827cc3a96df4dcc6fec374b994fdbd1'/>
<id>urn:sha1:935c631db827cc3a96df4dcc6fec374b994fdbd1</id>
<content type='text'>
hrtimer_start() incorrectly set the 'reprogram' flag to enqueue_hrtimer(),
which should only be 1 if the hrtimer is queued to the current CPU.

Doing otherwise could result in a reprogramming of the current CPU's
clockevents device, with a timer that is not queued to it - resulting in a
bogus next expiry value.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Michal Piotrowski &lt;michal.k.k.piotrowski@gmail.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] hrtimer: fix up unlocked access to wall_to_monotonic</title>
<updated>2007-03-17T02:25:05Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-03-16T21:38:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ad28d94abb1313bdf27e196676292c493f92f824'/>
<id>urn:sha1:ad28d94abb1313bdf27e196676292c493f92f824</id>
<content type='text'>
commit f4304ab21513b834c8fe3403927c60c2b81a72d7 (HZ free NTP) moved the
access to wall_to_monotonic in hrtimer_get_softirq_time() out of the
xtime_lock protection.

Move it back into the seq_lock section.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] hrtimer: prevent overrun DoS in hrtimer_forward()</title>
<updated>2007-03-17T02:25:05Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-03-16T21:38:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13788ccc41ceea5893f9c747c59bc0b28f2416c2'/>
<id>urn:sha1:13788ccc41ceea5893f9c747c59bc0b28f2416c2</id>
<content type='text'>
hrtimer_forward() does not check for the possible overflow of
timer-&gt;expires.  This can happen on 64 bit machines with large interval
values and results currently in an endless loop in the softirq because the
expiry value becomes negative and therefor the timer is expired all the
time.

Check for this condition and set the expiry value to the max.  expiry time
in the future.  The fix should be applied to stable kernel series as well.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] highres: do not run the TIMER_SOFTIRQ after switching to highres mode</title>
<updated>2007-03-06T17:30:25Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-03-06T09:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f8953856eb8dd62232aee6cacb46993dc2ac4869'/>
<id>urn:sha1:f8953856eb8dd62232aee6cacb46993dc2ac4869</id>
<content type='text'>
The TIMER_SOFTIRQ runs the hrtimers during bootup until a usable
clocksource and clock event sources are registered.  The switch to high
resolution mode happens inside of the TIMER_SOFTIRQ, but runs the softirq
afterwards.  That way the tick emulation timer, which was set up in the
switch to highres might be executed in the softirq context, which is a BUG.
 The rbtree has not to be touched by the softirq after the highres switch.

This BUG was observed by Andres Salomon, who provided the information to
debug it.

Return early from the softirq, when the switch was sucessful.

[dilinger@debian.org: add debug warning]
[akpm@linux-foundation.org: make debug warning compile]
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Andres Salomon &lt;dilinger@debian.org&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andres Salomon &lt;dilinger@debian.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] timer/hrtimer: take per cpu locks in sane order</title>
<updated>2007-03-05T15:57:53Z</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2007-03-05T08:30:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e81ce1f7ecdaed2844c75313b09af791d44e6373'/>
<id>urn:sha1:e81ce1f7ecdaed2844c75313b09af791d44e6373</id>
<content type='text'>
Doing something like this on a two cpu system

  # echo 0 &gt; /sys/devices/system/cpu/cpu0/online
  # echo 1 &gt; /sys/devices/system/cpu/cpu0/online
  # echo 0 &gt; /sys/devices/system/cpu/cpu1/online

will give me this:

  =======================================================
  [ INFO: possible circular locking dependency detected ]
  2.6.21-rc2-g562aa1d4-dirty #7
  -------------------------------------------------------
  bash/1282 is trying to acquire lock:
   (&amp;cpu_base-&gt;lock_key){.+..}, at: [&lt;000000000005f17e&gt;] hrtimer_cpu_notify+0xc6/0x240

  but task is already holding lock:
   (&amp;cpu_base-&gt;lock_key#2){.+..}, at: [&lt;000000000005f174&gt;] hrtimer_cpu_notify+0xbc/0x240

  which lock already depends on the new lock.

This happens because we have the following code in kernel/hrtimer.c:

  migrate_hrtimers(int cpu)
  [...]
  old_base = &amp;per_cpu(hrtimer_bases, cpu);
  new_base = &amp;get_cpu_var(hrtimer_bases);
  [...]
  spin_lock(&amp;new_base-&gt;lock);
  spin_lock(&amp;old_base-&gt;lock);

Which means the spinlocks are taken in an order which depends on which cpu
gets shut down from which other cpu. Therefore lockdep complains that there
might be an ABBA deadlock. Since migrate_hrtimers() gets only called on
cpu hotplug it's safe to assume that it isn't executed concurrently on a

The same problem exists in kernel/timer.c: migrate_timers().

As pointed out by Christian Borntraeger one possible solution to avoid
the locking order complaints would be to make sure that the locks are
always taken in the same order. E.g. by taking the lock of the cpu with
the lower number first.

To achieve this we introduce two new spinlock functions double_spin_lock
and double_spin_unlock which lock or unlock two locks in a given order.

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Cc: John Stultz &lt;johnstul@us.ibm.com&gt;
Cc: Christian Borntraeger &lt;cborntra@de.ibm.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Add debugging feature /proc/timer_stat</title>
<updated>2007-02-16T16:13:59Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2007-02-16T09:28:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=82f67cd9fca8c8762c15ba7ed0d5747588c1e221'/>
<id>urn:sha1:82f67cd9fca8c8762c15ba7ed0d5747588c1e221</id>
<content type='text'>
Add /proc/timer_stats support: debugging feature to profile timer expiration.
Both the starting site, process/PID and the expiration function is captured.
This allows the quick identification of timer event sources in a system.

Sample output:

# echo 1 &gt; /proc/timer_stats
# cat /proc/timer_stats
Timer Stats Version: v0.1
Sample period: 4.010 s
  24,     0 swapper          hrtimer_stop_sched_tick (hrtimer_sched_tick)
  11,     0 swapper          sk_reset_timer (tcp_delack_timer)
   6,     0 swapper          hrtimer_stop_sched_tick (hrtimer_sched_tick)
   2,     1 swapper          queue_delayed_work_on (delayed_work_timer_fn)
  17,     0 swapper          hrtimer_restart_sched_tick (hrtimer_sched_tick)
   2,     1 swapper          queue_delayed_work_on (delayed_work_timer_fn)
   4,  2050 pcscd            do_nanosleep (hrtimer_wakeup)
   5,  4179 sshd             sk_reset_timer (tcp_write_timer)
   4,  2248 yum-updatesd     schedule_timeout (process_timeout)
  18,     0 swapper          hrtimer_restart_sched_tick (hrtimer_sched_tick)
   3,     0 swapper          sk_reset_timer (tcp_delack_timer)
   1,     1 swapper          neigh_table_init_no_netlink (neigh_periodic_timer)
   2,     1 swapper          e1000_up (e1000_watchdog)
   1,     1 init             schedule_timeout (process_timeout)
100 total events, 25.24 events/sec

[ cleanups and hrtimers support from Thomas Gleixner &lt;tglx@linutronix.de&gt; ]
[bunk@stusta.de: nr_entries can become static]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: john stultz &lt;johnstul@us.ibm.com&gt;
Cc: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] hrtimers: add high resolution timer support</title>
<updated>2007-02-16T16:13:59Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-02-16T09:28:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54cdfdb47f73b5af3d1ebb0f1e383efbe70fde9e'/>
<id>urn:sha1:54cdfdb47f73b5af3d1ebb0f1e383efbe70fde9e</id>
<content type='text'>
Implement high resolution timers on top of the hrtimers infrastructure and the
clockevents / tick-management framework.  This provides accurate timers for
all hrtimer subsystem users.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: john stultz &lt;johnstul@us.ibm.com&gt;
Cc: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] tick-management: dyntick / highres functionality</title>
<updated>2007-02-16T16:13:59Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-02-16T09:28:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79bf2bb335b85db25d27421c798595a2fa2a0e82'/>
<id>urn:sha1:79bf2bb335b85db25d27421c798595a2fa2a0e82</id>
<content type='text'>
With Ingo Molnar &lt;mingo@elte.hu&gt;

Add functions to provide dynamic ticks and high resolution timers.  The code
which keeps track of jiffies and handles the long idle periods is shared
between tick based and high resolution timer based dynticks.  The dyntick
functionality can be disabled on the kernel commandline.  Provide also the
infrastructure to support high resolution timers.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: john stultz &lt;johnstul@us.ibm.com&gt;
Cc: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] clockevents: add core functionality</title>
<updated>2007-02-16T16:13:59Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-02-16T09:28:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d316c57ff6bfad9557462b9100f25c6260d2b774'/>
<id>urn:sha1:d316c57ff6bfad9557462b9100f25c6260d2b774</id>
<content type='text'>
Architectures register their clock event devices, in the clock events core.
Users of the clockevents core can get clock event devices for their use.  The
clockevents core code provides notification mechanisms for various clock
related management events.

This allows to control the clock event devices without the architectures
having to worry about the details of function assignment.  This is also a
preliminary for high resolution timers and dynamic ticks to allow the core
code to control the clock functionality without intrusive changes to the
architecture code.

[Fixes-by: Ingo Molnar &lt;mingo@elte.hu&gt;]
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Cc: john stultz &lt;johnstul@us.ibm.com&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
