aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/posix-timers.h
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2013-03-11 05:12:21 -0400
committerThomas Gleixner <tglx@linutronix.de>2013-04-17 14:51:01 -0400
commit5ed67f05f66c41e39880a6d61358438a25f9fee5 (patch)
treed3e52cca63e119a1f437b660f5d7a553f8ee37bc /include/linux/posix-timers.h
parent4e8f8b34b92b6514cc070aeb94d317cadd5071d7 (diff)
posix timers: Allocate timer id per process (v2)
Currently kernel generates IDs for posix timers in a global manner -- there's a kernel-wide IDR tree from which IDs are created. This makes it impossible to recreate a timer with a desired ID (in particular this is done by the CRIU checkpoint-restore project) -- since these IDs are global it may happen, that at the time we recreate a timer, the ID we want for it is already busy by some other timer. In order to address this, replace the IDR tree with a global hash table for timers and makes timer IDs unique per signal_struct (to which timers are linked anyway). With this, two timers belonging to different processes may have equal IDs and we can recreate either of them with the ID we want. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Matthew Helsley <matt.helsley@gmail.com> Link: http://lkml.kernel.org/r/513D9FF5.9010004@parallels.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/posix-timers.h')
-rw-r--r--include/linux/posix-timers.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 042058fdb0af..60bac697a91b 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -55,6 +55,7 @@ struct cpu_timer_list {
55/* POSIX.1b interval timer structure. */ 55/* POSIX.1b interval timer structure. */
56struct k_itimer { 56struct k_itimer {
57 struct list_head list; /* free/ allocate list */ 57 struct list_head list; /* free/ allocate list */
58 struct hlist_node t_hash;
58 spinlock_t it_lock; 59 spinlock_t it_lock;
59 clockid_t it_clock; /* which timer type */ 60 clockid_t it_clock; /* which timer type */
60 timer_t it_id; /* timer id */ 61 timer_t it_id; /* timer id */