<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/itimer.c, branch v2.6.16.45</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.16.45</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.16.45'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2006-02-01T16:53:12Z</updated>
<entry>
<title>[PATCH] hrtimers: fix oldvalue return in setitimer</title>
<updated>2006-02-01T16:53:12Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2006-02-01T11:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a16a1c095a2392d49fafea22f3a508e268ef7167'/>
<id>urn:sha1:a16a1c095a2392d49fafea22f3a508e268ef7167</id>
<content type='text'>
This resolves bugzilla bug#5617.  The oldvalue of the timer was read after the
timer was cancelled, so the remaining time was always zero.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] hrtimers: fixup itimer conversion</title>
<updated>2006-02-01T16:53:12Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2006-02-01T11:05:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bc1978d404befacd272d0321ef749cc3192e488b'/>
<id>urn:sha1:bc1978d404befacd272d0321ef749cc3192e488b</id>
<content type='text'>
The itimer conversion removed the locking which protects the timer and
variables in the shared signal structure.  Steven Rostedt found the problem in
the latest -rt patches.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] hrtimer: switch itimers to hrtimer</title>
<updated>2006-01-10T16:01:38Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2006-01-10T04:52:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2ff678b8da6478d861c1b0ecb3ac14575760e906'/>
<id>urn:sha1:2ff678b8da6478d861c1b0ecb3ac14575760e906</id>
<content type='text'>
switch itimers to a hrtimers-based implementation

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] itimer fixes</title>
<updated>2005-07-27T23:25:51Z</updated>
<author>
<name>George Anzinger</name>
<email>george@mvista.com</email>
</author>
<published>2005-07-27T18:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d912d1ff218195c248c770eb677726695e07aa40'/>
<id>urn:sha1:d912d1ff218195c248c770eb677726695e07aa40</id>
<content type='text'>
Fix the recent off-by-one fix in the itimer code:

1. The repeating timer is figured using the requested time
	(not +1 as we know where we are in the jiffie).

2. The tests for interval too large are left to the time_val to jiffie code.

Signed-off-by: George Anzinger &lt;george@mvista.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] ITIMER_REAL: fix possible deadlock and race</title>
<updated>2005-06-29T04:20:30Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2005-06-29T03:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f01b1b0baa454825ed95c28d2a6a71bbf4510836'/>
<id>urn:sha1:f01b1b0baa454825ed95c28d2a6a71bbf4510836</id>
<content type='text'>
As Steven Rostedt pointed out, there are 2 problems with ITIMER_REAL
timers.

1. do_setitimer() does not call del_timer_sync() in case
   when the timer is not pending (it_real_value() returns 0).
   This is wrong, the timer may still be running, and it can
   rearm itself.

2. It calls del_timer_sync() with tsk-&gt;sighand-&gt;siglock held.
   This is deadlockable, because timer's handler needs this
   lock too.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] setitimer timer expires too early</title>
<updated>2005-05-05T23:36:41Z</updated>
<author>
<name>Paulo Marques</name>
<email>pmarques@grupopie.com</email>
</author>
<published>2005-05-05T23:15:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b7e4e85337060354f8b860cc38066725559313a4'/>
<id>urn:sha1:b7e4e85337060354f8b860cc38066725559313a4</id>
<content type='text'>
It seems that the code responsible for this is in kernel/itimer.c:126:

	p-&gt;signal-&gt;real_timer.expires = jiffies + interval;
	add_timer(&amp;p-&gt;signal-&gt;real_timer);

If you request an interval of, lets say 900 usecs, the interval given by
timeval_to_jiffies will be 1.

If you request this when we are half-way between two timer ticks, the
interval will only give 400 usecs.

If we want to guarantee that we never ever give intervals less than
requested, the simple solution would be to change that to:

	p-&gt;signal-&gt;real_timer.expires = jiffies + interval + 1;

This however will produce pathological cases, like having a idle system
being requested 1 ms timeouts will give systematically 2 ms timeouts,
whereas currently it simply gives a few usecs less than 1 ms.

The complex (and more computationally expensive) solution would be to
check the gettimeofday time, and compute the correct number of jiffies.
This way, if we request a 300 usecs timer 200 usecs inside the timer
tick, we can wait just one tick, but not if we are 800 usecs inside the
tick. This would also mean that we would have to lock preemption during
these computations to avoid races, etc.

I've searched the archives but couldn't find this particular issue being
discussed before.

Attached is a patch to do the simple solution, in case anybody thinks
that it should be used.

Signed-Off-By: Paulo Marques &lt;pmarques@grupopie.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] make ITIMER_PROF, ITIMER_VIRTUAL per-process</title>
<updated>2005-03-08T02:17:29Z</updated>
<author>
<name>Roland McGrath</name>
<email>roland@redhat.com</email>
</author>
<published>2005-03-08T02:17:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d80d30ff8b9122aa51135e942e35566904f32ee5'/>
<id>urn:sha1:d80d30ff8b9122aa51135e942e35566904f32ee5</id>
<content type='text'>
POSIX requires that setitimer, getitimer, and alarm work on a per-process
basis.  Currently, Linux implements these for individual threads.  This patch
fixes these semantics for the ITIMER_PROF timer (which generates SIGPROF) and
the ITIMER_VIRTUAL timer (which generates SIGVTALRM), making them shared by
all threads in a process (thread group).  This patch should be applied after
the one that fixes ITIMER_REAL.

The essential machinery for these timers is tied into the new posix-timers
code for process CPU clocks and timers.  This patch requires the cputimers
patch and its dependencies.

Signed-off-by: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] make ITIMER_REAL per-process</title>
<updated>2005-03-08T02:17:13Z</updated>
<author>
<name>Roland McGrath</name>
<email>roland@redhat.com</email>
</author>
<published>2005-03-08T02:17:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c1dcd6c2d9b7478baf876725bd356f1b19eeaa65'/>
<id>urn:sha1:c1dcd6c2d9b7478baf876725bd356f1b19eeaa65</id>
<content type='text'>
POSIX requires that setitimer, getitimer, and alarm work on a per-process
basis.  Currently, Linux implements these for individual threads.  This patch
fixes these semantics for the ITIMER_REAL timer (which generates SIGALRM),
making it shared by all threads in a process (thread group).

Signed-off-by: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] cputime: introduce cputime</title>
<updated>2005-01-11T09:40:38Z</updated>
<author>
<name>Martin Schwidefsky</name>
<email>schwidefsky@de.ibm.com</email>
</author>
<published>2005-01-11T09:40:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0a71336b6a8858a525007c5b4e0d14ba57f9f315'/>
<id>urn:sha1:0a71336b6a8858a525007c5b4e0d14ba57f9f315</id>
<content type='text'>
This patch introduces the concept of (virtual) cputime.  Each architecture
can define its method to measure cputime.  The main idea is to define a
cputime_t type and a set of operations on it (see asm-generic/cputime.h).
Then use the type for utime, stime, cutime, cstime, it_virt_value,
it_virt_incr, it_prof_value and it_prof_incr and use the cputime operations
for each access to these variables.  The default implementation is jiffies
based and the effect of this patch for architectures which use the default
implementation should be neglectible.

There is a second type cputime64_t which is necessary for the kernel_stat
cpu statistics.  The default cputime_t is 32 bit and based on HZ, this will
overflow after 49.7 days.  This is not enough for kernel_stat (ihmo not
enough for a processes too), so it is necessary to have a 64 bit type.

The third thing that gets introduced by this patch is an additional field
for the /proc/stat interface: cpu steal time.  An architecture can account
cpu steal time by calls to the account_stealtime function.  The cpu which
backs a virtual processor doesn't spent all of its time for the virtual
cpu.  To get meaningful cpu usage numbers this involuntary wait time needs
to be accounted and exported to user space.

From: Hugh Dickins &lt;hugh@veritas.com&gt;

The p-&gt;signal check in account_system_time is insufficient.  If the timer
interrupt hits near the end of exit_notify, after EXIT_ZOMBIE has been set,
another cpu may release_task (NULLifying p-&gt;signal) in between
account_system_time's check and check_rlimit's dereference.  Nor should
account_it_prof risk send_sig.  But surely account_user_time is safe?

Signed-off-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] add missing linux/syscalls.h includes</title>
<updated>2004-10-18T15:54:02Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2004-10-18T15:54:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=09b9135c6e9950c0f12e3e6993ae52ab1baf0476'/>
<id>urn:sha1:09b9135c6e9950c0f12e3e6993ae52ab1baf0476</id>
<content type='text'>
I found that the prototypes for sys_waitid and sys_fcntl in
&lt;linux/syscalls.h&gt; don't match the implementation.  In order to keep all
prototypes in sync in the future, now include the header from each file
implementing any syscall.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
