<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/hrtimer.c, branch v2.6.29.2</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.29.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.29.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2009-04-27T17:37:00Z</updated>
<entry>
<title>hrtimer: fix rq-&gt;lock inversion (again)</title>
<updated>2009-04-27T17:37:00Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-03-13T11:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b457a610d6ab4d9bc654948da12968833510b2e'/>
<id>urn:sha1:7b457a610d6ab4d9bc654948da12968833510b2e</id>
<content type='text'>
upstream commit: 7f1e2ca9f04b02794597f60e7b1d43f0a1317939

It appears I inadvertly introduced rq-&gt;lock recursion to the
hrtimer_start() path when I delegated running already expired
timers to softirq context.

This patch fixes it by introducing a __hrtimer_start_range_ns()
method that will not use raise_softirq_irqoff() but
__raise_softirq_irqoff() which avoids the wakeup.

It then also changes schedule() to check for pending softirqs and
do the wakeup then, I'm not quite sure I like this last bit, nor
am I convinced its really needed.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: paulus@samba.org
LKML-Reference: &lt;20090313112301.096138802@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Tested-by: Mikael Pettersson &lt;mikpe@it.uu.se&gt;
Signed-off-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
</content>
</entry>
<entry>
<title>hrtimer: prevent negative expiry value after clock_was_set()</title>
<updated>2009-01-30T21:35:34Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-01-25T10:31:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b0a9b5111abf60ef07eade834f480e89004c7920'/>
<id>urn:sha1:b0a9b5111abf60ef07eade834f480e89004c7920</id>
<content type='text'>
Impact: prevent false positive WARN_ON() in clockevents_program_event()

clock_was_set() changes the base-&gt;offset of CLOCK_REALTIME and
enforces the reprogramming of the clockevent device to expire timers
which are based on CLOCK_REALTIME. If the clock change is large enough
then the subtraction of the timer expiry value and base-&gt;offset can
become negative which triggers the warning in
clockevents_program_event().

Check the subtraction result and set a negative value to 0.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>hrtimers: allow the hot-unplugging of all cpus</title>
<updated>2009-01-30T21:35:29Z</updated>
<author>
<name>Sebastien Dugue</name>
<email>sebastien.dugue@bull.net</email>
</author>
<published>2008-12-01T13:09:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=94df7de0289bc2df3d6e85cd2ece52bf42682f45'/>
<id>urn:sha1:94df7de0289bc2df3d6e85cd2ece52bf42682f45</id>
<content type='text'>
Impact: fix CPU hotplug hang on Power6 testbox

On architectures that support offlining all cpus (at least powerpc/pseries),
hot-unpluging the tick_do_timer_cpu can result in a system hang.

This comes from the fact that if the cpu going down happens to be the
cpu doing the tick, then as the tick_do_timer_cpu handover happens after the
cpu is dead (via the CPU_DEAD notification), we're left without ticks,
jiffies are frozen and any task relying on timers (msleep, ...) is stuck.
That's particularly the case for the cpu looping in __cpu_die() waiting
for the dying cpu to be dead.

This patch addresses this by having the tick_do_timer_cpu handover happen
earlier during the CPU_DYING notification. For this, a new clockevent
notification type is introduced (CLOCK_EVT_NOTIFY_CPU_DYING) which is triggered
in hrtimer_cpu_notify().

Signed-off-by: Sebastien Dugue &lt;sebastien.dugue@bull.net&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>hrtimers: increase clock min delta threshold while interrupt hanging</title>
<updated>2009-01-30T21:35:10Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2008-12-22T01:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7f22391cbe82a80a9f891d8bd10fc28ff248d1e2'/>
<id>urn:sha1:7f22391cbe82a80a9f891d8bd10fc28ff248d1e2</id>
<content type='text'>
Impact: avoid timer IRQ hanging slow systems

While using the function graph tracer on a virtualized system, the
hrtimer_interrupt can hang the system on an infinite loop.

This can be caused in several situations:

 - the hardware is very slow and HZ is set too high

 - something intrusive is slowing the system down (tracing under emulation)

... and the next clock events to program are always before the current time.

This patch implements a reasonable compromise: if such a situation is
detected, we share the CPUs time in 1/4 to process the hrtimer interrupts.
This is enough to let the system running without serious starvation.

It has been successfully tested under VirtualBox with 1000 HZ and 100 HZ
with function graph tracer launched. On both cases, the clock events were
increased until about 25 ms periodic ticks, which means 40 HZ.

So we change a hard to debug hang into a warning message and a system that
still manages to limp along.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-01-26T17:47:43Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-01-26T17:47:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1e70c7f7a9d4a3d2cc78b40e1d7768d99cd79899'/>
<id>urn:sha1:1e70c7f7a9d4a3d2cc78b40e1d7768d99cd79899</id>
<content type='text'>
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  hrtimers: fix inconsistent lock state on resume in hres_timers_resume
  time-sched.c: tick_nohz_update_jiffies should be static
  locking, hpet: annotate false positive warning
  kernel/fork.c: unused variable 'ret'
  itimers: remove the per-cpu-ish-ness
</content>
</entry>
<entry>
<title>hrtimers: fix inconsistent lock state on resume in hres_timers_resume</title>
<updated>2009-01-18T20:31:37Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2009-01-18T15:39:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1d4a7f1c4faf53eb9e822743ec8a70b3019a26d2'/>
<id>urn:sha1:1d4a7f1c4faf53eb9e822743ec8a70b3019a26d2</id>
<content type='text'>
Andrey Borzenkov reported this lockdep assert:

&gt; [17854.688347] =================================
&gt; [17854.688347] [ INFO: inconsistent lock state ]
&gt; [17854.688347] 2.6.29-rc2-1avb #1
&gt; [17854.688347] ---------------------------------
&gt; [17854.688347] inconsistent {in-hardirq-W} -&gt; {hardirq-on-W} usage.
&gt; [17854.688347] pm-suspend/18240 [HC0[0]:SC0[0]:HE1:SE1] takes:
&gt; [17854.688347]  (&amp;cpu_base-&gt;lock){++..}, at: [&lt;c0136fcc&gt;] retrigger_next_event+0x5c/0xa0
&gt; [17854.688347] {in-hardirq-W} state was registered at:
&gt; [17854.688347]   [&lt;c01443cd&gt;] __lock_acquire+0x79d/0x1930
&gt; [17854.688347]   [&lt;c01455bc&gt;] lock_acquire+0x5c/0x80
&gt; [17854.688347]   [&lt;c03092e5&gt;] _spin_lock+0x35/0x70
&gt; [17854.688347]   [&lt;c0136e61&gt;] hrtimer_run_queues+0x31/0x140
&gt; [17854.688347]   [&lt;c0128d98&gt;] run_local_timers+0x8/0x20
&gt; [17854.688347]   [&lt;c0128dd3&gt;] update_process_times+0x23/0x60
&gt; [17854.688347]   [&lt;c013e274&gt;] tick_periodic+0x24/0x80
&gt; [17854.688347]   [&lt;c013e2e2&gt;] tick_handle_periodic+0x12/0x70
&gt; [17854.688347]   [&lt;c0104e24&gt;] timer_interrupt+0x14/0x20
&gt; [17854.688347]   [&lt;c01607b9&gt;] handle_IRQ_event+0x29/0x60
&gt; [17854.688347]   [&lt;c0161c59&gt;] handle_level_irq+0x69/0xe0
&gt; [17854.688347]   [&lt;ffffffff&gt;] 0xffffffff
&gt; [17854.688347] irq event stamp: 55771
&gt; [17854.688347] hardirqs last  enabled at (55771): [&lt;c0309125&gt;] _spin_unlock_irqrestore+0x35/0x60
&gt; [17854.688347] hardirqs last disabled at (55770): [&lt;c0309419&gt;] _spin_lock_irqsave+0x19/0x80
&gt; [17854.688347] softirqs last  enabled at (54836): [&lt;c0124f54&gt;] __do_softirq+0xc4/0x110
&gt; [17854.688347] softirqs last disabled at (54831): [&lt;c01049ae&gt;] do_softirq+0x8e/0xe0
&gt; [17854.688347]
&gt; [17854.688347] other info that might help us debug this:
&gt; [17854.688347] 3 locks held by pm-suspend/18240:
&gt; [17854.688347]  #0:  (&amp;buffer-&gt;mutex){--..}, at: [&lt;c01dd4c5&gt;] sysfs_write_file+0x25/0x100
&gt; [17854.688347]  #1:  (pm_mutex){--..}, at: [&lt;c015056f&gt;] enter_state+0x4f/0x140
&gt; [17854.688347]  #2:  (dpm_list_mtx){--..}, at: [&lt;c027880f&gt;] device_pm_lock+0xf/0x20
&gt; [17854.688347]
&gt; [17854.688347] stack backtrace:
&gt; [17854.688347] Pid: 18240, comm: pm-suspend Not tainted 2.6.29-rc2-1avb #1
&gt; [17854.688347] Call Trace:
&gt; [17854.688347]  [&lt;c0306248&gt;] ? printk+0x18/0x20
&gt; [17854.688347]  [&lt;c0141fac&gt;] print_usage_bug+0x16c/0x1d0
&gt; [17854.688347]  [&lt;c0142bcf&gt;] mark_lock+0x8bf/0xc90
&gt; [17854.688347]  [&lt;c0106b8f&gt;] ? pit_next_event+0x2f/0x40
&gt; [17854.688347]  [&lt;c01441b0&gt;] __lock_acquire+0x580/0x1930
&gt; [17854.688347]  [&lt;c030916d&gt;] ? _spin_unlock+0x1d/0x20
&gt; [17854.688347]  [&lt;c0106b8f&gt;] ? pit_next_event+0x2f/0x40
&gt; [17854.688347]  [&lt;c013dd38&gt;] ? clockevents_program_event+0x98/0x160
&gt; [17854.688347]  [&lt;c0142fe8&gt;] ? mark_held_locks+0x48/0x90
&gt; [17854.688347]  [&lt;c0309125&gt;] ? _spin_unlock_irqrestore+0x35/0x60
&gt; [17854.688347]  [&lt;c0143229&gt;] ? trace_hardirqs_on_caller+0x139/0x190
&gt; [17854.688347]  [&lt;c014328b&gt;] ? trace_hardirqs_on+0xb/0x10
&gt; [17854.688347]  [&lt;c01455bc&gt;] lock_acquire+0x5c/0x80
&gt; [17854.688347]  [&lt;c0136fcc&gt;] ? retrigger_next_event+0x5c/0xa0
&gt; [17854.688347]  [&lt;c03092e5&gt;] _spin_lock+0x35/0x70
&gt; [17854.688347]  [&lt;c0136fcc&gt;] ? retrigger_next_event+0x5c/0xa0
&gt; [17854.688347]  [&lt;c0136fcc&gt;] retrigger_next_event+0x5c/0xa0
&gt; [17854.688347]  [&lt;c013711a&gt;] hres_timers_resume+0xa/0x10
&gt; [17854.688347]  [&lt;c013aa8e&gt;] timekeeping_resume+0xee/0x150
&gt; [17854.688347]  [&lt;c0273384&gt;] __sysdev_resume+0x14/0x50
&gt; [17854.688347]  [&lt;c0273407&gt;] sysdev_resume+0x47/0x80
&gt; [17854.688347]  [&lt;c02791ab&gt;] device_power_up+0xb/0x20
&gt; [17854.688347]  [&lt;c015043f&gt;] suspend_devices_and_enter+0xcf/0x150
&gt; [17854.688347]  [&lt;c0150c2f&gt;] ? freeze_processes+0x3f/0x90
&gt; [17854.688347]  [&lt;c0150614&gt;] enter_state+0xf4/0x140
&gt; [17854.688347]  [&lt;c01506dd&gt;] state_store+0x7d/0xc0
&gt; [17854.688347]  [&lt;c0150660&gt;] ? state_store+0x0/0xc0
&gt; [17854.688347]  [&lt;c0202da4&gt;] kobj_attr_store+0x24/0x30
&gt; [17854.688347]  [&lt;c01dd53c&gt;] sysfs_write_file+0x9c/0x100
&gt; [17854.688347]  [&lt;c019916c&gt;] vfs_write+0x9c/0x160
&gt; [17854.688347]  [&lt;c0103494&gt;] ? restore_nocheck_notrace+0x0/0xe
&gt; [17854.688347]  [&lt;c01dd4a0&gt;] ? sysfs_write_file+0x0/0x100
&gt; [17854.688347]  [&lt;c01992ed&gt;] sys_write+0x3d/0x70
&gt; [17854.688347]  [&lt;c0103371&gt;] sysenter_do_call+0x12/0x31

Andrey's analysis:

&gt; timekeeping_resume() is called via class -&gt;resume
&gt; method; and according to comments in sysdev_resume() and
&gt; device_power_up(), they are called with interrupts disabled.
&gt;
&gt; Looking at suspend_enter, irqs *are* disabled at this point.
&gt;
&gt; So it actually looks like something (may be some driver)
&gt; unconditionally enabled irqs in resume path.

Add a debug check to test this theory. If it triggers then it
triggers because the resume code calls it with irqs enabled,
which is a no-no not just for timekeeping_resume(), but also
bad for a number of other resume handlers.

Reported-by: Andrey Borzenkov &lt;arvidjaar@mail.ru&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>[CVE-2009-0029] System call wrappers part 01</title>
<updated>2009-01-14T13:15:18Z</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2009-01-14T13:14:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=58fd3aa288939d3097fa04505b25c2f5e6e144d1'/>
<id>urn:sha1:58fd3aa288939d3097fa04505b25c2f5e6e144d1</id>
<content type='text'>
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>hrtimer: splitout peek ahead functionality, fix</title>
<updated>2009-01-05T13:11:10Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-01-05T13:11:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=82c5b7b527ccc4b5d3cf832437e842f9d2920a79'/>
<id>urn:sha1:82c5b7b527ccc4b5d3cf832437e842f9d2920a79</id>
<content type='text'>
Impact: build fix on !CONFIG_HIGH_RES_TIMERS

Fix:

  kernel/hrtimer.c:1586: error: implicit declaration of function '__hrtimer_peek_ahead_timers'

Signen-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>hrtimer: fixup comments</title>
<updated>2009-01-05T12:14:34Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-01-05T10:28:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e3f1d883740b09e5116d4d4e30a6a6987264a83c'/>
<id>urn:sha1:e3f1d883740b09e5116d4d4e30a6a6987264a83c</id>
<content type='text'>
Clean up the comments

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>hrtimer: fix recursion deadlock by re-introducing the softirq</title>
<updated>2009-01-05T12:14:33Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-01-05T10:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a6037b61c2f5fc99c57c15b26d7cfa58bbb34008'/>
<id>urn:sha1:a6037b61c2f5fc99c57c15b26d7cfa58bbb34008</id>
<content type='text'>
Impact: fix rare runtime deadlock

There are a few sites that do:

  spin_lock_irq(&amp;foo)
  hrtimer_start(&amp;bar)
    __run_hrtimer(&amp;bar)
      func()
        spin_lock(&amp;foo)

which obviously deadlocks. In order to avoid this, never call __run_hrtimer()
from hrtimer_start*() context, but instead defer this to softirq context.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
