<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/hrtimer.c, branch v3.2.65</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.65</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.65'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-06-09T12:29:10Z</updated>
<entry>
<title>hrtimer: Set expiry time before switch_hrtimer_base()</title>
<updated>2014-06-09T12:29:10Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2014-05-12T08:12:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=25a430154805213ad127c6c165cd46c372a5a4b3'/>
<id>urn:sha1:25a430154805213ad127c6c165cd46c372a5a4b3</id>
<content type='text'>
commit 84ea7fe37908254c3bd90910921f6e1045c1747a upstream.

switch_hrtimer_base() calls hrtimer_check_target() which ensures that
we do not migrate a timer to a remote cpu if the timer expires before
the current programmed expiry time on that remote cpu.

But __hrtimer_start_range_ns() calls switch_hrtimer_base() before the
new expiry time is set. So the sanity check in hrtimer_check_target()
is operating on stale or even uninitialized data.

Update expiry time before calling switch_hrtimer_base().

[ tglx: Rewrote changelog once again ]

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: linaro-kernel@lists.linaro.org
Cc: linaro-networking@linaro.org
Cc: fweisbec@gmail.com
Cc: arvind.chauhan@arm.com
Link: http://lkml.kernel.org/r/81999e148745fc51bbcd0615823fbab9b2e87e23.1399882253.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Prevent remote enqueue of leftmost timers</title>
<updated>2014-06-09T12:29:04Z</updated>
<author>
<name>Leon Ma</name>
<email>xindong.ma@intel.com</email>
</author>
<published>2014-04-30T08:43:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dcb3bbe52762c722e92aca9ac20ba9ce792c46e0'/>
<id>urn:sha1:dcb3bbe52762c722e92aca9ac20ba9ce792c46e0</id>
<content type='text'>
commit 012a45e3f4af68e86d85cce060c6c2fed56498b2 upstream.

If a cpu is idle and starts an hrtimer which is not pinned on that
same cpu, the nohz code might target the timer to a different cpu.

In the case that we switch the cpu base of the timer we already have a
sanity check in place, which determines whether the timer is earlier
than the current leftmost timer on the target cpu. In that case we
enqueue the timer on the current cpu because we cannot reprogram the
clock event device on the target.

If the timers base is already the target CPU we do not have this
sanity check in place so we enqueue the timer as the leftmost timer in
the target cpus rb tree, but we cannot reprogram the clock event
device on the target cpu. So the timer expires late and subsequently
prevents the reprogramming of the target cpu clock event device until
the previously programmed event fires or a timer with an earlier
expiry time gets enqueued on the target cpu itself.

Add the same target check as we have for the switch base case and
start the timer on the current cpu if it would become the leftmost
timer on the target.

[ tglx: Rewrote subject and changelog ]

Signed-off-by: Leon Ma &lt;xindong.ma@intel.com&gt;
Link: http://lkml.kernel.org/r/1398847391-5994-1-git-send-email-xindong.ma@intel.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Prevent all reprogramming if hang detected</title>
<updated>2014-06-09T12:29:04Z</updated>
<author>
<name>Stuart Hayes</name>
<email>stuart.w.hayes@gmail.com</email>
</author>
<published>2014-04-29T22:55:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=152dbbc7b1ff1153c01e61738d178263a64405a3'/>
<id>urn:sha1:152dbbc7b1ff1153c01e61738d178263a64405a3</id>
<content type='text'>
commit 6c6c0d5a1c949d2e084706f9e5fb1fccc175b265 upstream.

If the last hrtimer interrupt detected a hang it sets hang_detected=1
and programs the clock event device with a delay to let the system
make progress.

If hang_detected == 1, we prevent reprogramming of the clock event
device in hrtimer_reprogram() but not in hrtimer_force_reprogram().

This can lead to the following situation:

hrtimer_interrupt()
   hang_detected = 1;
   program ce device to Xms from now (hang delay)

We have two timers pending:
   T1 expires 50ms from now
   T2 expires 5s from now

Now T1 gets canceled, which causes hrtimer_force_reprogram() to be
invoked, which in turn programs the clock event device to T2 (5
seconds from now).

Any hrtimer_start after that will not reprogram the hardware due to
hang_detected still being set. So we effectivly block all timers until
the T2 event fires and cleans up the hang situation.

Add a check for hang_detected to hrtimer_force_reprogram() which
prevents the reprogramming of the hang delay in the hardware
timer. The subsequent hrtimer_interrupt will resolve all outstanding
issues.

[ tglx: Rewrote subject and changelog and fixed up the comment in
  	hrtimer_force_reprogram() ]

Signed-off-by: Stuart Hayes &lt;stuart.w.hayes@gmail.com&gt;
Link: http://lkml.kernel.org/r/53602DC6.2060101@gmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Fix ktime_add_ns() overflow on 32bit architectures</title>
<updated>2013-05-13T14:02:15Z</updated>
<author>
<name>David Engraf</name>
<email>david.engraf@sysgo.com</email>
</author>
<published>2013-03-19T12:29:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=75ebfaade87e49f132a90d93020ddebc13a8289e'/>
<id>urn:sha1:75ebfaade87e49f132a90d93020ddebc13a8289e</id>
<content type='text'>
commit 51fd36f3fad8447c487137ae26b9d0b3ce77bb25 upstream.

One can trigger an overflow when using ktime_add_ns() on a 32bit
architecture not supporting CONFIG_KTIME_SCALAR.

When passing a very high value for u64 nsec, e.g. 7881299347898368000
the do_div() function converts this value to seconds (7881299347) which
is still to high to pass to the ktime_set() function as long. The result
in is a negative value.

The problem on my system occurs in the tick-sched.c,
tick_nohz_stop_sched_tick() when time_delta is set to
timekeeping_max_deferment(). The check for time_delta &lt; KTIME_MAX is
valid, thus ktime_add_ns() is called with a too large value resulting in
a negative expire value. This leads to an endless loop in the ticker code:

time_delta: 7881299347898368000
expires = ktime_add_ns(last_update, time_delta)
expires: negative value

This fix caps the value to KTIME_MAX.

This error doesn't occurs on 64bit or architectures supporting
CONFIG_KTIME_SCALAR (e.g. ARM, x86-32).

Signed-off-by: David Engraf &lt;david.engraf@sysgo.com&gt;
[jstultz: Minor tweaks to commit message &amp; header]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Add expiry time overflow check in hrtimer_interrupt</title>
<updated>2013-05-13T14:02:15Z</updated>
<author>
<name>Prarit Bhargava</name>
<email>prarit@redhat.com</email>
</author>
<published>2013-04-08T12:47:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=79d8ce897f2d73978e742334992da618a9fd839f'/>
<id>urn:sha1:79d8ce897f2d73978e742334992da618a9fd839f</id>
<content type='text'>
commit 8f294b5a139ee4b75e890ad5b443c93d1e558a8b upstream.

The settimeofday01 test in the LTP testsuite effectively does

        gettimeofday(current time);
        settimeofday(Jan 1, 1970 + 100 seconds);
        settimeofday(current time);

This test causes a stack trace to be displayed on the console during the
setting of timeofday to Jan 1, 1970 + 100 seconds:

[  131.066751] ------------[ cut here ]------------
[  131.096448] WARNING: at kernel/time/clockevents.c:209 clockevents_program_event+0x135/0x140()
[  131.104935] Hardware name: Dinar
[  131.108150] Modules linked in: sg nfsv3 nfs_acl nfsv4 auth_rpcgss nfs dns_resolver fscache lockd sunrpc nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat nf_nat_ipv4 nf_nat iptable_mangle ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ip_tables kvm_amd kvm sp5100_tco bnx2 i2c_piix4 crc32c_intel k10temp fam15h_power ghash_clmulni_intel amd64_edac_mod pcspkr serio_raw edac_mce_amd edac_core microcode xfs libcrc32c sr_mod sd_mod cdrom ata_generic crc_t10dif pata_acpi radeon i2c_algo_bit drm_kms_helper ttm drm ahci pata_atiixp libahci libata usb_storage i2c_core dm_mirror dm_region_hash dm_log dm_mod
[  131.176784] Pid: 0, comm: swapper/28 Not tainted 3.8.0+ #6
[  131.182248] Call Trace:
[  131.184684]  &lt;IRQ&gt;  [&lt;ffffffff810612af&gt;] warn_slowpath_common+0x7f/0xc0
[  131.191312]  [&lt;ffffffff8106130a&gt;] warn_slowpath_null+0x1a/0x20
[  131.197131]  [&lt;ffffffff810b9fd5&gt;] clockevents_program_event+0x135/0x140
[  131.203721]  [&lt;ffffffff810bb584&gt;] tick_program_event+0x24/0x30
[  131.209534]  [&lt;ffffffff81089ab1&gt;] hrtimer_interrupt+0x131/0x230
[  131.215437]  [&lt;ffffffff814b9600&gt;] ? cpufreq_p4_target+0x130/0x130
[  131.221509]  [&lt;ffffffff81619119&gt;] smp_apic_timer_interrupt+0x69/0x99
[  131.227839]  [&lt;ffffffff8161805d&gt;] apic_timer_interrupt+0x6d/0x80
[  131.233816]  &lt;EOI&gt;  [&lt;ffffffff81099745&gt;] ? sched_clock_cpu+0xc5/0x120
[  131.240267]  [&lt;ffffffff814b9ff0&gt;] ? cpuidle_wrap_enter+0x50/0xa0
[  131.246252]  [&lt;ffffffff814b9fe9&gt;] ? cpuidle_wrap_enter+0x49/0xa0
[  131.252238]  [&lt;ffffffff814ba050&gt;] cpuidle_enter_tk+0x10/0x20
[  131.257877]  [&lt;ffffffff814b9c89&gt;] cpuidle_idle_call+0xa9/0x260
[  131.263692]  [&lt;ffffffff8101c42f&gt;] cpu_idle+0xaf/0x120
[  131.268727]  [&lt;ffffffff815f8971&gt;] start_secondary+0x255/0x257
[  131.274449] ---[ end trace 1151a50552231615 ]---

When we change the system time to a low value like this, the value of
timekeeper-&gt;offs_real will be a negative value.

It seems that the WARN occurs because an hrtimer has been started in the time
between the releasing of the timekeeper lock and the IPI call (via a call to
on_each_cpu) in clock_was_set() in the do_settimeofday() code.  The end result
is that a REALTIME_CLOCK timer has been added with softexpires = expires =
KTIME_MAX.  The hrtimer_interrupt() fires/is called and the loop at
kernel/hrtimer.c:1289 is executed.  In this loop the code subtracts the
clock base's offset (which was set to timekeeper-&gt;offs_real in
do_settimeofday()) from the current hrtimer_cpu_base-&gt;expiry value (which
was KTIME_MAX):

	KTIME_MAX - (a negative value) = overflow

A simple check for an overflow can resolve this problem.  Using KTIME_MAX
instead of the overflow value will result in the hrtimer function being run,
and the reprogramming of the timer after that.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Rik van Riel &lt;riel@redhat.com&gt;
Signed-off-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
[jstultz: Tweaked commit subject]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Don't reinitialize a cpu_base lock on CPU_UP</title>
<updated>2013-04-25T19:25:30Z</updated>
<author>
<name>Michael Bohan</name>
<email>mbohan@codeaurora.org</email>
</author>
<published>2013-03-20T02:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=de16cb5fd913899fc45eceb0f60471234bdda05d'/>
<id>urn:sha1:de16cb5fd913899fc45eceb0f60471234bdda05d</id>
<content type='text'>
commit 84cc8fd2fe65866e49d70b38b3fdf7219dd92fe0 upstream.

The current code makes the assumption that a cpu_base lock won't be
held if the CPU corresponding to that cpu_base is offline, which isn't
always true.

If a hrtimer is not queued, then it will not be migrated by
migrate_hrtimers() when a CPU is offlined. Therefore, the hrtimer's
cpu_base may still point to a CPU which has subsequently gone offline
if the timer wasn't enqueued at the time the CPU went down.

Normally this wouldn't be a problem, but a cpu_base's lock is blindly
reinitialized each time a CPU is brought up. If a CPU is brought
online during the period that another thread is performing a hrtimer
operation on a stale hrtimer, then the lock will be reinitialized
under its feet, and a SPIN_BUG() like the following will be observed:

&lt;0&gt;[   28.082085] BUG: spinlock already unlocked on CPU#0, swapper/0/0
&lt;0&gt;[   28.087078]  lock: 0xc4780b40, value 0x0 .magic: dead4ead, .owner: &lt;none&gt;/-1, .owner_cpu: -1
&lt;4&gt;[   42.451150] [&lt;c0014398&gt;] (unwind_backtrace+0x0/0x120) from [&lt;c0269220&gt;] (do_raw_spin_unlock+0x44/0xdc)
&lt;4&gt;[   42.460430] [&lt;c0269220&gt;] (do_raw_spin_unlock+0x44/0xdc) from [&lt;c071b5bc&gt;] (_raw_spin_unlock+0x8/0x30)
&lt;4&gt;[   42.469632] [&lt;c071b5bc&gt;] (_raw_spin_unlock+0x8/0x30) from [&lt;c00a9ce0&gt;] (__hrtimer_start_range_ns+0x1e4/0x4f8)
&lt;4&gt;[   42.479521] [&lt;c00a9ce0&gt;] (__hrtimer_start_range_ns+0x1e4/0x4f8) from [&lt;c00aa014&gt;] (hrtimer_start+0x20/0x28)
&lt;4&gt;[   42.489247] [&lt;c00aa014&gt;] (hrtimer_start+0x20/0x28) from [&lt;c00e6190&gt;] (rcu_idle_enter_common+0x1ac/0x320)
&lt;4&gt;[   42.498709] [&lt;c00e6190&gt;] (rcu_idle_enter_common+0x1ac/0x320) from [&lt;c00e6440&gt;] (rcu_idle_enter+0xa0/0xb8)
&lt;4&gt;[   42.508259] [&lt;c00e6440&gt;] (rcu_idle_enter+0xa0/0xb8) from [&lt;c000f268&gt;] (cpu_idle+0x24/0xf0)
&lt;4&gt;[   42.516503] [&lt;c000f268&gt;] (cpu_idle+0x24/0xf0) from [&lt;c06ed3c0&gt;] (rest_init+0x88/0xa0)
&lt;4&gt;[   42.524319] [&lt;c06ed3c0&gt;] (rest_init+0x88/0xa0) from [&lt;c0c00978&gt;] (start_kernel+0x3d0/0x434)

As an example, this particular crash occurred when hrtimer_start() was
executed on CPU #0. The code locked the hrtimer's current cpu_base
corresponding to CPU #1. CPU #0 then tried to switch the hrtimer's
cpu_base to an optimal CPU which was online. In this case, it selected
the cpu_base corresponding to CPU #3.

Before it could proceed, CPU #1 came online and reinitialized the
spinlock corresponding to its cpu_base. Thus now CPU #0 held a lock
which was reinitialized. When CPU #0 finally ended up unlocking the
old cpu_base corresponding to CPU #1 so that it could switch to CPU
#3, we hit this SPIN_BUG() above while in switch_hrtimer_base().

CPU #0                            CPU #1
----                              ----
...                               &lt;offline&gt;
hrtimer_start()
lock_hrtimer_base(base #1)
...                               init_hrtimers_cpu()
switch_hrtimer_base()             ...
...                               raw_spin_lock_init(&amp;cpu_base-&gt;lock)
raw_spin_unlock(&amp;cpu_base-&gt;lock)  ...
&lt;spin_bug&gt;

Solve this by statically initializing the lock.

Signed-off-by: Michael Bohan &lt;mbohan@codeaurora.org&gt;
Link: http://lkml.kernel.org/r/1363745965-23475-1-git-send-email-mbohan@codeaurora.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Prevent hrtimer_enqueue_reprogram race</title>
<updated>2013-03-06T03:23:49Z</updated>
<author>
<name>Leonid Shatz</name>
<email>leonid.shatz@ravellosystems.com</email>
</author>
<published>2013-02-04T12:33:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d03659265edc9c622ecbdb94999a27f868a60a4b'/>
<id>urn:sha1:d03659265edc9c622ecbdb94999a27f868a60a4b</id>
<content type='text'>
commit b22affe0aef429d657bc6505aacb1c569340ddd2 upstream.

hrtimer_enqueue_reprogram contains a race which could result in
timer.base switch during unlock/lock sequence.

hrtimer_enqueue_reprogram is releasing the lock protecting the timer
base for calling raise_softirq_irqsoff() due to a lock ordering issue
versus rq-&gt;lock.

If during that time another CPU calls __hrtimer_start_range_ns() on
the same hrtimer, the timer base might switch, before the current CPU
can lock base-&gt;lock again and therefor the unlock_timer_base() call
will unlock the wrong lock.

[ tglx: Added comment and massaged changelog ]

Signed-off-by: Leonid Shatz &lt;leonid.shatz@ravellosystems.com&gt;
Signed-off-by: Izik Eidus &lt;izik.eidus@ravellosystems.com&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Link: http://lkml.kernel.org/r/1359981217-389-1-git-send-email-izik.eidus@ravellosystems.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Update hrtimer base offsets each hrtimer_interrupt</title>
<updated>2012-07-25T03:11:37Z</updated>
<author>
<name>John Stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2012-07-10T22:43:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b9a231293995c1211d254a38d60f21980ed5d07'/>
<id>urn:sha1:7b9a231293995c1211d254a38d60f21980ed5d07</id>
<content type='text'>
commit 5baefd6d84163443215f4a99f6a20f054ef11236 upstream.

The update of the hrtimer base offsets on all cpus cannot be made
atomically from the timekeeper.lock held and interrupt disabled region
as smp function calls are not allowed there.

clock_was_set(), which enforces the update on all cpus, is called
either from preemptible process context in case of do_settimeofday()
or from the softirq context when the offset modification happened in
the timer interrupt itself due to a leap second.

In both cases there is a race window for an hrtimer interrupt between
dropping timekeeper lock, enabling interrupts and clock_was_set()
issuing the updates. Any interrupt which arrives in that window will
see the new time but operate on stale offsets.

So we need to make sure that an hrtimer interrupt always sees a
consistent state of time and offsets.

ktime_get_update_offsets() allows us to get the current monotonic time
and update the per cpu hrtimer base offsets from hrtimer_interrupt()
to capture a consistent state of monotonic time and the offsets. The
function replaces the existing ktime_get() calls in hrtimer_interrupt().

The overhead of the new function vs. ktime_get() is minimal as it just
adds two store operations.

This ensures that any changes to realtime or boottime offsets are
noticed and stored into the per-cpu hrtimer base structures, prior to
any hrtimer expiration and guarantees that timers are not expired early.

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Reviewed-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Link: http://lkml.kernel.org/r/1341960205-56738-8-git-send-email-johnstul@us.ibm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimers: Move lock held region in hrtimer_interrupt()</title>
<updated>2012-07-25T03:11:36Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2012-07-10T22:43:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d6a2a0400e36bcd2892272995a65b4bca029220f'/>
<id>urn:sha1:d6a2a0400e36bcd2892272995a65b4bca029220f</id>
<content type='text'>
commit 196951e91262fccda81147d2bcf7fdab08668b40 upstream.

We need to update the base offsets from this code and we need to do
that under base-&gt;lock. Move the lock held region around the
ktime_get() calls. The ktime_get() calls are going to be replaced with
a function which gets the time and the offsets atomically.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Link: http://lkml.kernel.org/r/1341960205-56738-6-git-send-email-johnstul@us.ibm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>hrtimer: Provide clock_was_set_delayed()</title>
<updated>2012-07-25T03:11:34Z</updated>
<author>
<name>John Stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2012-07-10T22:43:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3c910e7e46810c73e21196867b7ec63d58a0a45c'/>
<id>urn:sha1:3c910e7e46810c73e21196867b7ec63d58a0a45c</id>
<content type='text'>
commit f55a6faa384304c89cfef162768e88374d3312cb upstream.

clock_was_set() cannot be called from hard interrupt context because
it calls on_each_cpu().

For fixing the widely reported leap seconds issue it is necessary to
call it from hard interrupt context, i.e. the timer tick code, which
does the timekeeping updates.

Provide a new function which denotes it in the hrtimer cpu base
structure of the cpu on which it is called and raise the hrtimer
softirq. We then execute the clock_was_set() notificiation from
softirq context in run_hrtimer_softirq(). The hrtimer softirq is
rarely used, so polling the flag there is not a performance issue.

[ tglx: Made it depend on CONFIG_HIGH_RES_TIMERS. We really should get
  rid of all this ifdeffery ASAP ]

Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Reported-by: Jan Engelhardt &lt;jengelh@inai.de&gt;
Reviewed-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Link: http://lkml.kernel.org/r/1341960205-56738-2-git-send-email-johnstul@us.ibm.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
