mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 13:21:45 +00:00
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>
This commit is contained in:
parent
4e8f8b34b9
commit
5ed67f05f6
3 changed files with 72 additions and 38 deletions
|
@ -55,6 +55,7 @@ struct cpu_timer_list {
|
|||
/* POSIX.1b interval timer structure. */
|
||||
struct k_itimer {
|
||||
struct list_head list; /* free/ allocate list */
|
||||
struct hlist_node t_hash;
|
||||
spinlock_t it_lock;
|
||||
clockid_t it_clock; /* which timer type */
|
||||
timer_t it_id; /* timer id */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue