<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/timer.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] dynticks: fix hrtimer rounding error in next_timer_interrupt</title>
<updated>2007-03-25T21:57:34Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-03-25T12:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9501b6cf5541f0d576d566a463f1e7d3eaaab4eb'/>
<id>urn:sha1:9501b6cf5541f0d576d566a463f1e7d3eaaab4eb</id>
<content type='text'>
The rework of next_timer_interrupt() fixed the timer wheel bugs, but
invented a rounding error versus the next hrtimer event. This is caused
by the conversion of the hrtimer internal representation to relative
jiffies.

This causes bug #8100:
http://bugzilla.kernel.org/show_bug.cgi?id=8100

next_timer_interrupt() returns "now" in such a case and causes the code
in tick_nohz_stop_sched_tick() to trigger the timer softirq, which is
bogus as no timer is due for expiry. This results in an endless context
switching between idle and ksoftirqd until a timer is due for expiry.

Modify the hrtimer evaluation so that, it returns now + 1, when the
conversion results in a delta &lt; 1 jiffie.

It's confirmed to resolve bug #8100

Reported-by: Emil Karlson &lt;jkarlson@cc.hut.fi&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] fix vsyscall settimeofday</title>
<updated>2007-03-06T17:30:25Z</updated>
<author>
<name>Daniel Walker</name>
<email>dwalker@mvista.com</email>
</author>
<published>2007-03-06T09:42:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90675a27fa3eb0e97f1d040b183cceb44316e669'/>
<id>urn:sha1:90675a27fa3eb0e97f1d040b183cceb44316e669</id>
<content type='text'>
I've only seen this on x86_64.

The vsyscall state only gets updated when a timer interrupts comes in.  So
if the time is set long before the next timer, there will be a period when
a gettimeofday() won't reflect the correct time.

I added an explicit update_vsyscall() during the settimeofday(), that way
the vsyscall state doesn't get stale.

Signed-off-by: Daniel Walker &lt;dwalker@mvista.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: John Stultz &lt;johnstul@us.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] Save/restore periodic tick information over suspend/resume</title>
<updated>2007-03-06T17:30:24Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2007-03-06T07:25:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6321dd60c76b2e12383bc06046288b15397ed3a0'/>
<id>urn:sha1:6321dd60c76b2e12383bc06046288b15397ed3a0</id>
<content type='text'>
The programming of periodic tick devices needs to be saved/restored
across suspend/resume - otherwise we might end up with a system coming
up that relies on getting a PIT (or HPET) interrupt, while those devices
default to 'no interrupts' after powerup. (To confuse things it worked
to a certain degree on some systems because the lapic gets initialized
as a side-effect of SMP bootup.)

This suspend / resume thing was dropped unintentionally during the
last-minute -mm code reshuffling.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&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] kernel-doc fixes for 2.6.20-git15 (non-drivers)</title>
<updated>2007-03-01T22:53:37Z</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2007-03-01T04:12:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05fb6bf0b29552b64dc86f405a484de2514e0ac2'/>
<id>urn:sha1:05fb6bf0b29552b64dc86f405a484de2514e0ac2</id>
<content type='text'>
Fix kernel-doc warnings in 2.6.20-git15 (lib/, mm/, kernel/, include/).

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.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] update timekeeping_is_continuous comment</title>
<updated>2007-03-01T22:53:36Z</updated>
<author>
<name>Daniel Walker</name>
<email>dwalker@mvista.com</email>
</author>
<published>2007-03-01T04:12:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9d6346311418d12e90cca9384e5fbbe2ffa18efb'/>
<id>urn:sha1:9d6346311418d12e90cca9384e5fbbe2ffa18efb</id>
<content type='text'>
Signed-off-by: Daniel Walker &lt;dwalker@mvista.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] generic: vsyscall-gtod support for GENERIC_TIME</title>
<updated>2007-02-16T16:14:00Z</updated>
<author>
<name>john stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2007-02-16T09:28:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=acc9a9dcdd0dd1d295c2f2ee02c27c761bd63cb1'/>
<id>urn:sha1:acc9a9dcdd0dd1d295c2f2ee02c27c761bd63cb1</id>
<content type='text'>
Provides generic infrastructure for vsyscall-gtod.

[akpm@osdl.org: cleanup]
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Andi Kleen &lt;ak@muc.de&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] 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] 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>
</feed>
