<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/timer.c, branch v3.4.78</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.78</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.78'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-07-22T01:19:01Z</updated>
<entry>
<title>timer: Fix jiffies wrap behavior of round_jiffies_common()</title>
<updated>2013-07-22T01:19:01Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@gmail.com</email>
</author>
<published>2013-05-21T18:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b1648b7dc2f1954a3492e5127a4b6a408814964'/>
<id>urn:sha1:7b1648b7dc2f1954a3492e5127a4b6a408814964</id>
<content type='text'>
commit 9e04d3804d3ac97d8c03a41d78d0f0674b5d01e1 upstream.

Direct compare of jiffies related values does not work in the wrap
around case. Replace it with time_is_after_jiffies().

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Link: http://lkml.kernel.org/r/519BC066.5080600@acm.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>timer: Don't reinitialize the cpu base lock during CPU_UP_PREPARE</title>
<updated>2013-05-19T17:54:39Z</updated>
<author>
<name>Tirupathi Reddy</name>
<email>tirupath@codeaurora.org</email>
</author>
<published>2013-05-14T08:29:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ed032fd4d81041e4002fc55ff1832ee588f103da'/>
<id>urn:sha1:ed032fd4d81041e4002fc55ff1832ee588f103da</id>
<content type='text'>
commit 42a5cf46cd56f46267d2a9fcf2655f4078cd3042 upstream.

An inactive timer's base can refer to a offline cpu's base.

In the current code, 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 trying to modify an inactive timer on that CPU
with holding its timer base lock, then the lock will be reinitialized
under its feet. This leads to following SPIN_BUG().

&lt;0&gt; BUG: spinlock already unlocked on CPU#3, kworker/u:3/1466
&lt;0&gt; lock: 0xe3ebe000, .magic: dead4ead, .owner: kworker/u:3/1466, .owner_cpu: 1
&lt;4&gt; [&lt;c0013dc4&gt;] (unwind_backtrace+0x0/0x11c) from [&lt;c026e794&gt;] (do_raw_spin_unlock+0x40/0xcc)
&lt;4&gt; [&lt;c026e794&gt;] (do_raw_spin_unlock+0x40/0xcc) from [&lt;c076c160&gt;] (_raw_spin_unlock+0x8/0x30)
&lt;4&gt; [&lt;c076c160&gt;] (_raw_spin_unlock+0x8/0x30) from [&lt;c009b858&gt;] (mod_timer+0x294/0x310)
&lt;4&gt; [&lt;c009b858&gt;] (mod_timer+0x294/0x310) from [&lt;c00a5e04&gt;] (queue_delayed_work_on+0x104/0x120)
&lt;4&gt; [&lt;c00a5e04&gt;] (queue_delayed_work_on+0x104/0x120) from [&lt;c04eae00&gt;] (sdhci_msm_bus_voting+0x88/0x9c)
&lt;4&gt; [&lt;c04eae00&gt;] (sdhci_msm_bus_voting+0x88/0x9c) from [&lt;c04d8780&gt;] (sdhci_disable+0x40/0x48)
&lt;4&gt; [&lt;c04d8780&gt;] (sdhci_disable+0x40/0x48) from [&lt;c04bf300&gt;] (mmc_release_host+0x4c/0xb0)
&lt;4&gt; [&lt;c04bf300&gt;] (mmc_release_host+0x4c/0xb0) from [&lt;c04c7aac&gt;] (mmc_sd_detect+0x90/0xfc)
&lt;4&gt; [&lt;c04c7aac&gt;] (mmc_sd_detect+0x90/0xfc) from [&lt;c04c2504&gt;] (mmc_rescan+0x7c/0x2c4)
&lt;4&gt; [&lt;c04c2504&gt;] (mmc_rescan+0x7c/0x2c4) from [&lt;c00a6a7c&gt;] (process_one_work+0x27c/0x484)
&lt;4&gt; [&lt;c00a6a7c&gt;] (process_one_work+0x27c/0x484) from [&lt;c00a6e94&gt;] (worker_thread+0x210/0x3b0)
&lt;4&gt; [&lt;c00a6e94&gt;] (worker_thread+0x210/0x3b0) from [&lt;c00aad9c&gt;] (kthread+0x80/0x8c)
&lt;4&gt; [&lt;c00aad9c&gt;] (kthread+0x80/0x8c) from [&lt;c000ea80&gt;] (kernel_thread_exit+0x0/0x8)

As an example, this particular crash occurred when CPU #3 is executing
mod_timer() on an inactive timer whose base is refered to offlined CPU
#2.  The code locked the timer_base corresponding to CPU #2. Before it
could proceed, CPU #2 came online and reinitialized the spinlock
corresponding to its base. Thus now CPU #3 held a lock which was
reinitialized. When CPU #3 finally ended up unlocking the old cpu_base
corresponding to CPU #2, we hit the above SPIN_BUG().

CPU #0		CPU #3				       CPU #2
------		-------				       -------
.....		 ......				      &lt;Offline&gt;
		mod_timer()
		 lock_timer_base
		   spin_lock_irqsave(&amp;base-&gt;lock)

cpu_up(2)	 .....				        ......
							init_timers_cpu()
....		 .....				    	spin_lock_init(&amp;base-&gt;lock)
.....		   spin_unlock_irqrestore(&amp;base-&gt;lock)  ......
		   &lt;spin_bug&gt;

Allocation of per_cpu timer vector bases is done only once under
"tvec_base_done[]" check. In the current code, spinlock_initialization
of base-&gt;lock isn't under this check. When a CPU is up each time the
base lock is reinitialized. Move base spinlock initialization under
the check.

Signed-off-by: Tirupathi Reddy &lt;tirupath@codeaurora.org&gt;
Link: http://lkml.kernel.org/r/1368520142-4136-1-git-send-email-tirupath@codeaurora.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>timers: Fix endless looping between cascade() and internal_add_timer()</title>
<updated>2012-10-21T16:27:59Z</updated>
<author>
<name>Hildner, Christian</name>
<email>christian.hildner@siemens.com</email>
</author>
<published>2012-10-08T13:49:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=00dff266efe889d4fc6569f3e39ae7195cb83da7'/>
<id>urn:sha1:00dff266efe889d4fc6569f3e39ae7195cb83da7</id>
<content type='text'>
commit 26cff4e2aa4d666dc6a120ea34336b5057e3e187 upstream.

Adding two (or more) timers with large values for "expires" (they have
to reside within tv5 in the same list) leads to endless looping
between cascade() and internal_add_timer() in case CONFIG_BASE_SMALL
is one and jiffies are crossing the value 1 &lt;&lt; 18. The bug was
introduced between 2.6.11 and 2.6.12 (and survived for quite some
time).

This patch ensures that when cascade() is called timers within tv5 are
not added endlessly to their own list again, instead they are added to
the next lower tv level tv4 (as expected).

Signed-off-by: Christian Hildner &lt;christian.hildner@siemens.com&gt;
Reviewed-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Link: http://lkml.kernel.org/r/98673C87CB31274881CFFE0B65ECC87B0F5FC1963E@DEFTHW99EA4MSX.ww902.siemens.net
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2012-01-06T15:53:34Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-01-06T15:53:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8c717b72dec32a50666175b62b41de24e4b39be7'/>
<id>urn:sha1:8c717b72dec32a50666175b62b41de24e4b39be7</id>
<content type='text'>
* 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  timer: Use debugobjects to catch deletion of uninitialized timers
  timer: Setup uninitialized timer with a stub callback
  debugobjects: Extend to assert that an object is initialized
  debugobjects: Be smarter about static objects
</content>
</entry>
<entry>
<title>sys_getppid: add missing rcu_dereference</title>
<updated>2011-12-09T15:50:29Z</updated>
<author>
<name>Mandeep Singh Baines</name>
<email>msb@chromium.org</email>
</author>
<published>2011-12-08T22:34:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=031af165b1cd295ef04d2bfbcae9bc3cb9180735'/>
<id>urn:sha1:031af165b1cd295ef04d2bfbcae9bc3cb9180735</id>
<content type='text'>
In order to safely dereference current-&gt;real_parent inside an
rcu_read_lock, we need an rcu_dereference.

Signed-off-by: Mandeep Singh Baines &lt;msb@chromium.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Kees Cook &lt;keescook@chromium.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>timer: Use debugobjects to catch deletion of uninitialized timers</title>
<updated>2011-11-23T17:49:23Z</updated>
<author>
<name>Christine Chan</name>
<email>cschan@codeaurora.org</email>
</author>
<published>2011-11-08T03:48:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dc4218bd0fe499fce2896f88101ea42dac1f60fc'/>
<id>urn:sha1:dc4218bd0fe499fce2896f88101ea42dac1f60fc</id>
<content type='text'>
del_timer_sync() calls debug_object_assert_init() to assert that
a timer has been initialized before calling lock_timer_base().
lock_timer_base() would spin forever on a NULL(uninit-ed) base.
The check is added to del_timer() to prevent silent failure, even
though it would not get stuck in an infinite loop.

[ sboyd@codeaurora.org: Remove WARN, intialize timer function]

Signed-off-by: Christine Chan &lt;cschan@codeaurora.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Link: http://lkml.kernel.org/r/1320724108-20788-4-git-send-email-sboyd@codeaurora.org
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>timer: Setup uninitialized timer with a stub callback</title>
<updated>2011-11-23T17:49:23Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2011-11-08T03:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fb16b8cf0b66386134b09e7b8b7056450272d159'/>
<id>urn:sha1:fb16b8cf0b66386134b09e7b8b7056450272d159</id>
<content type='text'>
Remove the WARN_ON() in timer_fixup_activate() as we now get the
debugobjects printout in the debugobjects activate check.

We also assign a dummy timer callback so that if the timer is
actually set to fire we don't oops.

[ tglx@linutronix.de: Split out the debugobjects vs. the timer change ]

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Christine Chan &lt;cschan@codeaurora.org&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/1320724108-20788-2-git-send-email-sboyd@codeaurora.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>kernel: Map most files to use export.h instead of module.h</title>
<updated>2011-10-31T13:20:12Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-05-23T18:51:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9984de1a5a8a96275fcab818f7419af5a3c86e71'/>
<id>urn:sha1:9984de1a5a8a96275fcab818f7419af5a3c86e71</id>
<content type='text'>
The changed files were only including linux/module.h for the
EXPORT_SYMBOL infrastructure, and nothing else.  Revector them
onto the isolated export header for faster compile times.

Nothing to see here but a whole lot of instances of:

  -#include &lt;linux/module.h&gt;
  +#include &lt;linux/export.h&gt;

This commit is only changing the kernel dir; next targets
will probably be mm, fs, the arch dirs, etc.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>timers: Consider slack value in mod_timer()</title>
<updated>2011-06-03T13:02:32Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>sebastian@breakpoint.cc</email>
</author>
<published>2011-05-21T10:58:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1c3cc11602111d1318c2a5743bd2e88c82813927'/>
<id>urn:sha1:1c3cc11602111d1318c2a5743bd2e88c82813927</id>
<content type='text'>
There is an optimization which does not update the timer if the timer
was pending and the expiration time was unchanged.

Since commit 3bbb9ec9 ("timers: Introduce the concept of timer slack
for legacy timers") this optimization is no longer applied for timers
where the expiration time got extended due to the slack value. So we
need to check again after the expiration time might have been updated.

[ tglx: Made it a single check by applying slack first and sorting
  out the slack = 0 value (all timeouts &lt; 256 jiffies) early ]

Signed-off-by: Sebastian Andrzej Siewior &lt;sebastian@breakpoint.cc&gt;
Link: http://lkml.kernel.org/r/20110521105828.GA29442@Chamillionaire.breakpoint.cc
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2011-03-16T01:53:35Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-03-16T01:53:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=420c1c572d4ceaa2f37b6311b7017ac6cf049fe2'/>
<id>urn:sha1:420c1c572d4ceaa2f37b6311b7017ac6cf049fe2</id>
<content type='text'>
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (62 commits)
  posix-clocks: Check write permissions in posix syscalls
  hrtimer: Remove empty hrtimer_init_hres_timer()
  hrtimer: Update hrtimer-&gt;state documentation
  hrtimer: Update base[CLOCK_BOOTTIME].offset correctly
  timers: Export CLOCK_BOOTTIME via the posix timers interface
  timers: Add CLOCK_BOOTTIME hrtimer base
  time: Extend get_xtime_and_monotonic_offset() to also return sleep
  time: Introduce get_monotonic_boottime and ktime_get_boottime
  hrtimers: extend hrtimer base code to handle more then 2 clockids
  ntp: Remove redundant and incorrect parameter check
  mn10300: Switch do_timer() to xtimer_update()
  posix clocks: Introduce dynamic clocks
  posix-timers: Cleanup namespace
  posix-timers: Add support for fd based clocks
  x86: Add clock_adjtime for x86
  posix-timers: Introduce a syscall for clock tuning.
  time: Splitout compat timex accessors
  ntp: Add ADJ_SETOFFSET mode bit
  time: Introduce timekeeping_inject_offset
  posix-timer: Update comment
  ...

Fix up new system-call-related conflicts in
	arch/x86/ia32/ia32entry.S
	arch/x86/include/asm/unistd_32.h
	arch/x86/include/asm/unistd_64.h
	arch/x86/kernel/syscall_table_32.S
(name_to_handle_at()/open_by_handle_at() vs clock_adjtime()), and some
due to movement of get_jiffies_64() in:
	kernel/time.c
</content>
</entry>
</feed>
