<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/hrtimer.c, branch v2.6.37</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.37</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.37'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2010-10-14T11:29:59Z</updated>
<entry>
<title>hrtimer: Preserve timer state in remove_hrtimer()</title>
<updated>2010-10-14T11:29:59Z</updated>
<author>
<name>Salman Qazi</name>
<email>sqazi@google.com</email>
</author>
<published>2010-10-12T14:25:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f13d4f979c518119bba5439dd2364d76d31dcd3f'/>
<id>urn:sha1:f13d4f979c518119bba5439dd2364d76d31dcd3f</id>
<content type='text'>
The race is described as follows:

CPU X                                 CPU Y
remove_hrtimer
// state &amp; QUEUED == 0
timer-&gt;state = CALLBACK
unlock timer base
timer-&gt;f(n) //very long
                                  hrtimer_start
                                    lock timer base
                                    remove_hrtimer // no effect
                                    hrtimer_enqueue
                                    timer-&gt;state = CALLBACK |
                                                   QUEUED
                                    unlock timer base
                                  hrtimer_start
                                    lock timer base
                                    remove_hrtimer
                                        mode = INACTIVE
                                        // CALLBACK bit lost!
                                    switch_hrtimer_base
                                            CALLBACK bit not set:
                                                    timer-&gt;base
                                                    changes to a
                                                    different CPU.
lock this CPU's timer base

The bug was introduced with commit ca109491f (hrtimer: removing all ur
callback modes) in 2.6.29

[ tglx: Feed new state via local variable and add a comment. ]

Signed-off-by: Salman Qazi &lt;sqazi@google.com&gt;
Cc: akpm@linux-foundation.org
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
LKML-Reference: &lt;20101012142351.8485.21823.stgit@dungbeetle.mtv.corp.google.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>gcc-4.6: kernel/*: Fix unused but set warnings</title>
<updated>2010-09-05T12:36:58Z</updated>
<author>
<name>Andi Kleen</name>
<email>andi@firstfloor.org</email>
</author>
<published>2010-08-10T21:17:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3bd3de66f60df4c9a2076e2886a622458929056'/>
<id>urn:sha1:b3bd3de66f60df4c9a2076e2886a622458929056</id>
<content type='text'>
No real bugs I believe, just some dead code.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: andi@firstfloor.org
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2010-08-06T20:18:29Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-08-06T20:18:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b62ad9ab181a67207a4c8c373461b587c4861a68'/>
<id>urn:sha1:b62ad9ab181a67207a4c8c373461b587c4861a68</id>
<content type='text'>
* 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  um: Fix read_persistent_clock fallout
  kgdb: Do not access xtime directly
  powerpc: Clean up obsolete code relating to decrementer and timebase
  powerpc: Rework VDSO gettimeofday to prevent time going backwards
  clocksource: Add __clocksource_updatefreq_hz/khz methods
  x86: Convert common clocksources to use clocksource_register_hz/khz
  timekeeping: Make xtime and wall_to_monotonic static
  hrtimer: Cleanup direct access to wall_to_monotonic
  um: Convert to use read_persistent_clock
  timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset
  powerpc: Cleanup xtime usage
  powerpc: Simplify update_vsyscall
  time: Kill off CONFIG_GENERIC_TIME
  time: Implement timespec_add
  x86: Fix vtime/file timestamp inconsistencies

Trivial conflicts in Documentation/feature-removal-schedule.txt

Much less trivial conflicts in arch/powerpc/kernel/time.c resolved as
per Thomas' earlier merge commit 47916be4e28c ("Merge branch
'powerpc.cherry-picks' into timers/clocksource")
</content>
</entry>
<entry>
<title>hrtimer: Cleanup direct access to wall_to_monotonic</title>
<updated>2010-07-27T10:40:55Z</updated>
<author>
<name>John Stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2010-07-14T00:56:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ab4351a4c888016620f43bde605b3d0964af339'/>
<id>urn:sha1:8ab4351a4c888016620f43bde605b3d0964af339</id>
<content type='text'>
Provides an accessor function to replace hrtimer.c's
direct access of wall_to_monotonic.

This will allow wall_to_monotonic to be made static as
planned in Documentation/feature-removal-schedule.txt

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
LKML-Reference: &lt;1279068988-21864-9-git-send-email-johnstul@us.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>sched: Change nohz idle load balancing logic to push model</title>
<updated>2010-06-09T08:34:52Z</updated>
<author>
<name>Venkatesh Pallipadi</name>
<email>venki@google.com</email>
</author>
<published>2010-05-22T00:09:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=83cd4fe27ad8446619b2e030b171b858501de87d'/>
<id>urn:sha1:83cd4fe27ad8446619b2e030b171b858501de87d</id>
<content type='text'>
In the new push model, all idle CPUs indeed go into nohz mode. There is
still the concept of idle load balancer (performing the load balancing
on behalf of all the idle cpu's in the system). Busy CPU kicks the nohz
balancer when any of the nohz CPUs need idle load balancing.
The kickee CPU does the idle load balancing on behalf of all idle CPUs
instead of the normal idle balance.

This addresses the below two problems with the current nohz ilb logic:
* the idle load balancer continued to have periodic ticks during idle and
  wokeup frequently, even though it did not have any rebalancing to do on
  behalf of any of the idle CPUs.
* On x86 and CPUs that have APIC timer stoppage on idle CPUs, this
  periodic wakeup can result in a periodic additional interrupt on a CPU
  doing the timer broadcast.

Also currently we are migrating the unpinned timers from an idle to the cpu
doing idle load balancing (when all the cpus in the system are idle,
there is no idle load balancing cpu and timers get added to the same idle cpu
where the request was made. So the existing optimization works only on semi idle
system).

And In semi idle system, we no longer have periodic ticks on the idle load
balancer CPU. Using that cpu will add more delays to the timers than intended
(as that cpu's timer base may not be uptodate wrt jiffies etc). This was
causing mysterious slowdowns during boot etc.

For now, in the semi idle case, use the nearest busy cpu for migrating timers
from an idle cpu.  This is good for power-savings anyway.

Signed-off-by: Venkatesh Pallipadi &lt;venki@google.com&gt;
Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
LKML-Reference: &lt;1274486981.2840.46.camel@sbs-t61.sc.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>hrtimer: Avoid double seqlock</title>
<updated>2010-05-26T14:15:37Z</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>stf_xl@wp.pl</email>
</author>
<published>2010-05-25T21:49:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=174bd1994ec67a6e6191c4ed8e5dac17fa221b84'/>
<id>urn:sha1:174bd1994ec67a6e6191c4ed8e5dac17fa221b84</id>
<content type='text'>
hrtimer_get_softirq_time() has it's own xtime lock protection, so it's
safe to use plain __current_kernel_time() and avoid the double seqlock
loop.

Signed-off-by: Stanislaw Gruszka &lt;stf_xl@wp.pl&gt;
LKML-Reference: &lt;20100525214912.GA1934@r2bh72.net.upc.cz&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>hrtimers: Provide schedule_hrtimeout for CLOCK_REALTIME</title>
<updated>2010-04-06T19:50:03Z</updated>
<author>
<name>Carsten Emde</name>
<email>C.Emde@osadl.org</email>
</author>
<published>2010-04-02T20:40:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=351b3f7a21e413a9b14d0393171497d2373bd702'/>
<id>urn:sha1:351b3f7a21e413a9b14d0393171497d2373bd702</id>
<content type='text'>
The current version of schedule_hrtimeout() always uses the
monotonic clock. Some system calls such as mq_timedsend()
and mq_timedreceive(), however, require the use of the wall
clock due to the definition of the system call.

This patch provides the infrastructure to use schedule_hrtimeout() 
with a CLOCK_REALTIME timer.

Signed-off-by: Carsten Emde &lt;C.Emde@osadl.org&gt;
Tested-by: Pradyumna Sampath &lt;pradysam@gmail.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Arjan van de Veen &lt;arjan@infradead.org&gt;
LKML-Reference: &lt;20100402204331.167439615@osadl.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>hrtimers: Convert to raw_spinlocks</title>
<updated>2009-12-14T22:55:34Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-11-17T15:36:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ecb49d1a639acbacfc3771cae5ec07bed5df3847'/>
<id>urn:sha1:ecb49d1a639acbacfc3771cae5ec07bed5df3847</id>
<content type='text'>
Convert locks which cannot be sleeping locks in preempt-rt to
raw_spinlocks.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>hrtimer: move timer stats helper functions to hrtimer.c</title>
<updated>2009-12-10T12:08:11Z</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2009-12-10T09:56:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f201907dfe4ad42c44006ddfcec00ed12e59497'/>
<id>urn:sha1:5f201907dfe4ad42c44006ddfcec00ed12e59497</id>
<content type='text'>
There is no reason to make timer_stats_hrtimer_set_start_info and
friends visible to the rest of the kernel. So move all of them to
hrtimer.c.  Also make timer_stats_hrtimer_set_start_info a static
inline function so it gets inlined and we avoid another function call.
Based on a patch by Thomas Gleixner.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
LKML-Reference: &lt;20091210095629.GC4144@osiris.boeblingen.de.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>hrtimer: Tune hrtimer_interrupt hang logic</title>
<updated>2009-12-10T12:08:11Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-11-13T16:05:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=41d2e494937715d3150e5c75d01f0e75ae899337'/>
<id>urn:sha1:41d2e494937715d3150e5c75d01f0e75ae899337</id>
<content type='text'>
The hrtimer_interrupt hang logic adjusts min_delta_ns based on the
execution time of the hrtimer callbacks.

This is error-prone for virtual machines, where a guest vcpu can be
scheduled out during the execution of the callbacks (and the callbacks
themselves can do operations that translate to blocking operations in
the hypervisor), which in can lead to large min_delta_ns rendering the
system unusable.

Replace the current heuristics with something more reliable. Allow the
interrupt code to try 3 times to catch up with the lost time. If that
fails use the total time spent in the interrupt handler to defer the
next timer interrupt so the system can catch up with other things
which got delayed. Limit that deferment to 100ms.

The retry events and the maximum time spent in the interrupt handler
are recorded and exposed via /proc/timer_list

Inspired by a patch from Marcelo.

Reported-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Cc: kvm@vger.kernel.org

</content>
</entry>
</feed>
