<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/kernel, branch v2.6.14</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>[PATCH] Yet more posix-cpu-timer fixes</title>
<updated>2005-10-27T16:08:43+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>roland@redhat.com</email>
</author>
<published>2005-10-27T10:16:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=72ab373a5688a78cbdaf3bf96012e597d5399bb7'/>
<id>72ab373a5688a78cbdaf3bf96012e597d5399bb7</id>
<content type='text'>
This just makes sure that a thread's expiry times can't get reset after
it clears them in do_exit.

This is what allowed us to re-introduce the stricter BUG_ON() check in
a362f463a6d316d14daed0f817e151835ce97ff7.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This just makes sure that a thread's expiry times can't get reset after
it clears them in do_exit.

This is what allowed us to re-introduce the stricter BUG_ON() check in
a362f463a6d316d14daed0f817e151835ce97ff7.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "remove false BUG_ON() from run_posix_cpu_timers()"</title>
<updated>2005-10-27T16:07:33+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2005-10-27T16:07:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a362f463a6d316d14daed0f817e151835ce97ff7'/>
<id>a362f463a6d316d14daed0f817e151835ce97ff7</id>
<content type='text'>
This reverts commit 3de463c7d9d58f8cf3395268230cb20a4c15bffa.

Roland has another patch that allows us to leave the BUG_ON() in place
by just making sure that the condition it tests for really is always
true.

That goes in next.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 3de463c7d9d58f8cf3395268230cb20a4c15bffa.

Roland has another patch that allows us to leave the BUG_ON() in place
by just making sure that the condition it tests for really is always
true.

That goes in next.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Fix cpu timers expiration time</title>
<updated>2005-10-26T22:21:14+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2005-10-26T16:26:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7a4ed937aa44acdeb8c6ba671509dc7b54b09d3a'/>
<id>7a4ed937aa44acdeb8c6ba671509dc7b54b09d3a</id>
<content type='text'>
There's a silly off-by-one error in the code that updates the expiration
of posix CPU timers, causing them to not be properly updated when they
hit exactly on their expiration time (which should be the normal case).

This causes them to then fire immediately again, and only _then_ get
properly updated.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's a silly off-by-one error in the code that updates the expiration
of posix CPU timers, causing them to not be properly updated when they
hit exactly on their expiration time (which should be the normal case).

This causes them to then fire immediately again, and only _then_ get
properly updated.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>posix cpu timers: fix timer ordering</title>
<updated>2005-10-26T18:23:06+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2005-10-26T18:23:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=70ab81c2ed3d1323e7d6805bf59cbb570dff7937'/>
<id>70ab81c2ed3d1323e7d6805bf59cbb570dff7937</id>
<content type='text'>
Pointed out by Oleg Nesterov, who has been walking over the code
forwards and backwards.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pointed out by Oleg Nesterov, who has been walking over the code
forwards and backwards.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] export cpu_online_map</title>
<updated>2005-10-26T17:39:43+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2005-10-26T08:59:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bb32051532fed727de0d513a9a578b54c0b7ea5a'/>
<id>bb32051532fed727de0d513a9a578b54c0b7ea5a</id>
<content type='text'>
With CONFIG_SMP=n:

*** Warning: "cpu_online_map" [drivers/firmware/dcdbas.ko] undefined!

due to set_cpus_allowed().

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With CONFIG_SMP=n:

*** Warning: "cpu_online_map" [drivers/firmware/dcdbas.ko] undefined!

due to set_cpus_allowed().

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] posix-timers: fix posix_cpu_timer_set() vs run_posix_cpu_timers() race</title>
<updated>2005-10-24T15:13:14+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2005-10-24T14:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a69ac4a78d8bd9e1ec478bd7297d4f047fcd44a8'/>
<id>a69ac4a78d8bd9e1ec478bd7297d4f047fcd44a8</id>
<content type='text'>
This might be harmless, but looks like a race from code inspection (I
was unable to trigger it).  I must admit, I don't understand why we
can't return TIMER_RETRY after 'spin_unlock(&amp;p-&gt;sighand-&gt;siglock)'
without doing bump_cpu_timer(), but this is what original code does.

posix_cpu_timer_set:

	read_lock(&amp;tasklist_lock);

	spin_lock(&amp;p-&gt;sighand-&gt;siglock);
	list_del_init(&amp;timer-&gt;it.cpu.entry);
	spin_unlock(&amp;p-&gt;sighand-&gt;siglock);

We are probaly deleting the timer from run_posix_cpu_timers's 'firing'
local list_head while run_posix_cpu_timers() does list_for_each_safe.

Various bad things can happen, for example we can just delete this timer
so that list_for_each() will not notice it and run_posix_cpu_timers()
will not reset '-&gt;firing' flag. In that case,

	....

	if (timer-&gt;it.cpu.firing) {
		read_unlock(&amp;tasklist_lock);
		timer-&gt;it.cpu.firing = -1;
		return TIMER_RETRY;
	}

sys_timer_settime() goes to 'retry:', calls posix_cpu_timer_set() again,
it returns TIMER_RETRY ...

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This might be harmless, but looks like a race from code inspection (I
was unable to trigger it).  I must admit, I don't understand why we
can't return TIMER_RETRY after 'spin_unlock(&amp;p-&gt;sighand-&gt;siglock)'
without doing bump_cpu_timer(), but this is what original code does.

posix_cpu_timer_set:

	read_lock(&amp;tasklist_lock);

	spin_lock(&amp;p-&gt;sighand-&gt;siglock);
	list_del_init(&amp;timer-&gt;it.cpu.entry);
	spin_unlock(&amp;p-&gt;sighand-&gt;siglock);

We are probaly deleting the timer from run_posix_cpu_timers's 'firing'
local list_head while run_posix_cpu_timers() does list_for_each_safe.

Various bad things can happen, for example we can just delete this timer
so that list_for_each() will not notice it and run_posix_cpu_timers()
will not reset '-&gt;firing' flag. In that case,

	....

	if (timer-&gt;it.cpu.firing) {
		read_unlock(&amp;tasklist_lock);
		timer-&gt;it.cpu.firing = -1;
		return TIMER_RETRY;
	}

sys_timer_settime() goes to 'retry:', calls posix_cpu_timer_set() again,
it returns TIMER_RETRY ...

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] posix-timers: exit path cleanup</title>
<updated>2005-10-24T15:12:35+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2005-10-24T10:36:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b'/>
<id>ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b</id>
<content type='text'>
No need to rebalance when task exited

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No need to rebalance when task exited

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] posix-timers: remove false BUG_ON() from run_posix_cpu_timers()</title>
<updated>2005-10-24T15:12:35+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2005-10-24T10:34:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3de463c7d9d58f8cf3395268230cb20a4c15bffa'/>
<id>3de463c7d9d58f8cf3395268230cb20a4c15bffa</id>
<content type='text'>
do_exit() clears -&gt;it_##clock##_expires, but nothing prevents
another cpu to attach the timer to exiting process after that.

After exit_notify() does 'write_unlock_irq(&amp;tasklist_lock)' and
before do_exit() calls 'schedule() local timer interrupt can find
tsk-&gt;exit_state != 0. If that state was EXIT_DEAD (or another cpu
does sys_wait4) interrupted task has -&gt;signal == NULL.

At this moment exiting task has no pending cpu timers, they were cleaned
up in __exit_signal()-&gt;posix_cpu_timers_exit{,_group}(), so we can just
return from irq.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
do_exit() clears -&gt;it_##clock##_expires, but nothing prevents
another cpu to attach the timer to exiting process after that.

After exit_notify() does 'write_unlock_irq(&amp;tasklist_lock)' and
before do_exit() calls 'schedule() local timer interrupt can find
tsk-&gt;exit_state != 0. If that state was EXIT_DEAD (or another cpu
does sys_wait4) interrupted task has -&gt;signal == NULL.

At this moment exiting task has no pending cpu timers, they were cleaned
up in __exit_signal()-&gt;posix_cpu_timers_exit{,_group}(), so we can just
return from irq.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] posix-timers: fix cleanup_timers() and run_posix_cpu_timers() races</title>
<updated>2005-10-24T15:12:35+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2005-10-23T16:25:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=108150ea78003044e41150c75259447b2c0953b6'/>
<id>108150ea78003044e41150c75259447b2c0953b6</id>
<content type='text'>
1. cleanup_timers() sets timer-&gt;task = NULL under tasklist + -&gt;sighand locks.
   That means that this code in posix_cpu_timer_del() and posix_cpu_timer_set()

   		lock_timer(timer);
		if (timer-&gt;task == NULL)
			return;
		read_lock(tasklist);
		put_task_struct(timer-&gt;task)

   is racy. With this patch timer-&gt;task modified and accounted only under
   timer-&gt;it_lock. Sadly, this means that dead task_struct won't be freed
   until timer deleted or armed.

2. run_posix_cpu_timers() collects expired timers into local list under
   tasklist + -&gt;sighand again. That means that posix_cpu_timer_del()
   should check timer-&gt;it.cpu.firing under these locks too.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. cleanup_timers() sets timer-&gt;task = NULL under tasklist + -&gt;sighand locks.
   That means that this code in posix_cpu_timer_del() and posix_cpu_timer_set()

   		lock_timer(timer);
		if (timer-&gt;task == NULL)
			return;
		read_lock(tasklist);
		put_task_struct(timer-&gt;task)

   is racy. With this patch timer-&gt;task modified and accounted only under
   timer-&gt;it_lock. Sadly, this means that dead task_struct won't be freed
   until timer deleted or armed.

2. run_posix_cpu_timers() collects expired timers into local list under
   tasklist + -&gt;sighand again. That means that posix_cpu_timer_del()
   should check timer-&gt;it.cpu.firing under these locks too.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Posix timers: limit number of timers firing at once</title>
<updated>2005-10-23T17:02:50+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2005-10-23T17:02:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e80eda94d3eaf1d12cfc97878eff77cd679dabc9'/>
<id>e80eda94d3eaf1d12cfc97878eff77cd679dabc9</id>
<content type='text'>
Bursty timers aren't good for anybody, very much including latency for
other programs when we trigger lots of timers in interrupt context.  So
set a random limit, after which we'll handle the rest on the next timer
tick.

Noted by Oleg Nesterov &lt;oleg@tv-sign.ru&gt;

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bursty timers aren't good for anybody, very much including latency for
other programs when we trigger lots of timers in interrupt context.  So
set a random limit, after which we'll handle the rest on the next timer
tick.

Noted by Oleg Nesterov &lt;oleg@tv-sign.ru&gt;

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
