<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/include/linux/hrtimer.h, branch v2.6.36-rc7</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>hrtimers: Provide schedule_hrtimeout for CLOCK_REALTIME</title>
<updated>2010-04-06T19:50:03+00:00</updated>
<author>
<name>Carsten Emde</name>
<email>C.Emde@osadl.org</email>
</author>
<published>2010-04-02T20:40:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=351b3f7a21e413a9b14d0393171497d2373bd702'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimers: Convert to raw_spinlocks</title>
<updated>2009-12-14T22:55:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-11-17T15:36:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ecb49d1a639acbacfc3771cae5ec07bed5df3847'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: move timer stats helper functions to hrtimer.c</title>
<updated>2009-12-10T12:08:11+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2009-12-10T09:56:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5f201907dfe4ad42c44006ddfcec00ed12e59497'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Tune hrtimer_interrupt hang logic</title>
<updated>2009-12-10T12:08:11+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-11-13T16:05:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=41d2e494937715d3150e5c75d01f0e75ae899337'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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

</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Fix /proc/timer_list regression</title>
<updated>2009-11-20T10:25:48+00:00</updated>
<author>
<name>Feng Tang</name>
<email>feng.tang@intel.com</email>
</author>
<published>2009-09-03T08:32:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8629ea2eaba8ca0de2e38ce1b4a825e16255976e'/>
<id>8629ea2eaba8ca0de2e38ce1b4a825e16255976e</id>
<content type='text'>
commit 507e1231 (timer stats: Optimize by adding quick check to avoid
function calls) introduced a regression in /proc/timer_list.

/proc/timer_list shows now
 #0: &lt;c27d46b0&gt;, tick_sched_timer, S:01, &lt;(null)&gt;, /-1
instead of
 #0: &lt;c27d46b0&gt;, tick_sched_timer, S:01, hrtimer_start, swapper/0

Revert the hrtimer quick check for now. The optimization needs more
thought, but this is neither 2.6.32-rc7 nor stable material.

[ tglx: - Removed unrelated changes from the original patch
  	- Prevent unneccesary call to timer_stats_update_stats
	- massaged the changelog ]

Signed-off-by: Feng Tang &lt;feng.tang@intel.com&gt;
LKML-Reference: &lt;alpine.LFD.2.00.0911181933540.24119@localhost.localdomain&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: stable@kernel.org
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 507e1231 (timer stats: Optimize by adding quick check to avoid
function calls) introduced a regression in /proc/timer_list.

/proc/timer_list shows now
 #0: &lt;c27d46b0&gt;, tick_sched_timer, S:01, &lt;(null)&gt;, /-1
instead of
 #0: &lt;c27d46b0&gt;, tick_sched_timer, S:01, hrtimer_start, swapper/0

Revert the hrtimer quick check for now. The optimization needs more
thought, but this is neither 2.6.32-rc7 nor stable material.

[ tglx: - Removed unrelated changes from the original patch
  	- Prevent unneccesary call to timer_stats_update_stats
	- massaged the changelog ]

Signed-off-by: Feng Tang &lt;feng.tang@intel.com&gt;
LKML-Reference: &lt;alpine.LFD.2.00.0911181933540.24119@localhost.localdomain&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: stable@kernel.org
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'linus' into timers/core</title>
<updated>2009-08-14T13:59:30+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-08-14T13:59:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4cd1993f0046fbc765dbf20af90966f5661e3789'/>
<id>4cd1993f0046fbc765dbf20af90966f5661e3789</id>
<content type='text'>
Reason: Martin's timekeeping cleanup series depends on both
timers/core and mainline changes.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reason: Martin's timekeeping cleanup series depends on both
timers/core and mainline changes.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Remove cb_entry from struct hrtimer</title>
<updated>2009-07-22T15:12:32+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-07-22T11:40:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fbd90375d7531927d312766b548376d909811b4d'/>
<id>fbd90375d7531927d312766b548376d909811b4d</id>
<content type='text'>
It's unused, remove it.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
LKML-Reference: &lt;new-submission&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's unused, remove it.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
LKML-Reference: &lt;new-submission&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>timer stats: fix quick check optimization</title>
<updated>2009-07-10T17:33:00+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2009-07-09T09:24:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f9f868dbcca961ed62f1df1d114abd0c38c47dce'/>
<id>f9f868dbcca961ed62f1df1d114abd0c38c47dce</id>
<content type='text'>
git commit 507e1231 "timer stats: Optimize by adding quick check to
avoid function calls" added one wrong check so that one unnecessary
function call isn't elimated.

time_stats_account_hrtimer() checks if timer-&gt;start_pid isn't
initialized in order to find out if timer_stats_update_stats() should
be called.  However start_pid is initialized with -1 instead of 0, so
that the function call always happens.

Check timer-&gt;start_site like in timer_stats_account_timer() to fix
this.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git commit 507e1231 "timer stats: Optimize by adding quick check to
avoid function calls" added one wrong check so that one unnecessary
function call isn't elimated.

time_stats_account_hrtimer() checks if timer-&gt;start_pid isn't
initialized in order to find out if timer_stats_update_stats() should
be called.  However start_pid is initialized with -1 instead of 0, so
that the function call always happens.

Check timer-&gt;start_site like in timer_stats_account_timer() to fix
this.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>timer stats: Optimize by adding quick check to avoid function calls</title>
<updated>2009-06-24T09:15:09+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2009-06-23T15:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=507e123151149e578c9aae33eb876c49824da5f8'/>
<id>507e123151149e578c9aae33eb876c49824da5f8</id>
<content type='text'>
When the kernel is configured with CONFIG_TIMER_STATS but timer
stats are runtime disabled we still get calls to
__timer_stats_timer_set_start_info which initializes some
fields in the corresponding struct timer_list.

So add some quick checks in the the timer stats setup functions
to avoid function calls to __timer_stats_timer_set_start_info
when timer stats are disabled.

In an artificial workload that does nothing but playing ping
pong with a single tcp packet via loopback this decreases cpu
consumption by 1 - 1.5%.

This is part of a modified function trace output on SLES11:

 perl-2497  [00] 28630647177732388 [+  125]: sk_reset_timer &lt;-tcp_v4_rcv
 perl-2497  [00] 28630647177732513 [+  125]: mod_timer &lt;-sk_reset_timer
 perl-2497  [00] 28630647177732638 [+  125]: __timer_stats_timer_set_start_info &lt;-mod_timer
 perl-2497  [00] 28630647177732763 [+  125]: __mod_timer &lt;-mod_timer
 perl-2497  [00] 28630647177732888 [+  125]: __timer_stats_timer_set_start_info &lt;-__mod_timer
 perl-2497  [00] 28630647177733013 [+   93]: lock_timer_base &lt;-__mod_timer

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Mustafa Mesanovic &lt;mustafa.mesanovic@de.ibm.com&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
LKML-Reference: &lt;20090623153811.GA4641@osiris.boeblingen.de.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the kernel is configured with CONFIG_TIMER_STATS but timer
stats are runtime disabled we still get calls to
__timer_stats_timer_set_start_info which initializes some
fields in the corresponding struct timer_list.

So add some quick checks in the the timer stats setup functions
to avoid function calls to __timer_stats_timer_set_start_info
when timer stats are disabled.

In an artificial workload that does nothing but playing ping
pong with a single tcp packet via loopback this decreases cpu
consumption by 1 - 1.5%.

This is part of a modified function trace output on SLES11:

 perl-2497  [00] 28630647177732388 [+  125]: sk_reset_timer &lt;-tcp_v4_rcv
 perl-2497  [00] 28630647177732513 [+  125]: mod_timer &lt;-sk_reset_timer
 perl-2497  [00] 28630647177732638 [+  125]: __timer_stats_timer_set_start_info &lt;-mod_timer
 perl-2497  [00] 28630647177732763 [+  125]: __mod_timer &lt;-mod_timer
 perl-2497  [00] 28630647177732888 [+  125]: __timer_stats_timer_set_start_info &lt;-__mod_timer
 perl-2497  [00] 28630647177733013 [+   93]: lock_timer_base &lt;-__mod_timer

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Mustafa Mesanovic &lt;mustafa.mesanovic@de.ibm.com&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
LKML-Reference: &lt;20090623153811.GA4641@osiris.boeblingen.de.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>timers: Framework for identifying pinned timers</title>
<updated>2009-05-13T14:52:42+00:00</updated>
<author>
<name>Arun R Bharadwaj</name>
<email>arun@linux.vnet.ibm.com</email>
</author>
<published>2009-04-16T06:43:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=597d0275736dad9c3bda6f0a00a1c477dc0f37b1'/>
<id>597d0275736dad9c3bda6f0a00a1c477dc0f37b1</id>
<content type='text'>
* Arun R Bharadwaj &lt;arun@linux.vnet.ibm.com&gt; [2009-04-16 12:11:36]:

This patch creates a new framework for identifying cpu-pinned timers
and hrtimers.

This framework is needed because pinned timers are expected to fire on
the same CPU on which they are queued. So it is essential to identify
these and not migrate them, in case there are any.

For regular timers, the currently existing add_timer_on() can be used
queue pinned timers and subsequently mod_timer_pinned() can be used
to modify the 'expires' field.

For hrtimers, new modes HRTIMER_ABS_PINNED and HRTIMER_REL_PINNED are
added to queue cpu-pinned hrtimer.

[ tglx: use .._PINNED mode argument instead of creating tons of new
functions ]

Signed-off-by: Arun R Bharadwaj &lt;arun@linux.vnet.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Arun R Bharadwaj &lt;arun@linux.vnet.ibm.com&gt; [2009-04-16 12:11:36]:

This patch creates a new framework for identifying cpu-pinned timers
and hrtimers.

This framework is needed because pinned timers are expected to fire on
the same CPU on which they are queued. So it is essential to identify
these and not migrate them, in case there are any.

For regular timers, the currently existing add_timer_on() can be used
queue pinned timers and subsequently mod_timer_pinned() can be used
to modify the 'expires' field.

For hrtimers, new modes HRTIMER_ABS_PINNED and HRTIMER_REL_PINNED are
added to queue cpu-pinned hrtimer.

[ tglx: use .._PINNED mode argument instead of creating tons of new
functions ]

Signed-off-by: Arun R Bharadwaj &lt;arun@linux.vnet.ibm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
