35
35
#include "timekeeping.h"
36
36
#include "posix-timers.h"
37
37
38
- /*
39
- * Management arrays for POSIX timers. Timers are now kept in static hash table
40
- * with 512 entries.
41
- * Timer ids are allocated by local routine, which selects proper hash head by
42
- * key, constructed from current->signal address and per signal struct counter.
43
- * This keeps timer ids unique per process, but now they can intersect between
44
- * processes.
45
- */
38
+ static struct kmem_cache * posix_timers_cache ;
46
39
47
40
/*
48
- * Lets keep our timers in a slab cache :-)
41
+ * Timers are managed in a hash table for lockless lookup. The hash key is
42
+ * constructed from current::signal and the timer ID and the timer is
43
+ * matched against current::signal and the timer ID when walking the hash
44
+ * bucket list.
45
+ *
46
+ * This allows checkpoint/restore to reconstruct the exact timer IDs for
47
+ * a process.
49
48
*/
50
- static struct kmem_cache * posix_timers_cache ;
51
-
52
49
static DEFINE_HASHTABLE (posix_timers_hashtable , 9 ) ;
53
50
static DEFINE_SPINLOCK (hash_lock );
54
51
@@ -65,15 +62,6 @@ static const struct k_clock clock_realtime, clock_monotonic;
65
62
#error "SIGEV_THREAD_ID must not share bit with other SIGEV values!"
66
63
#endif
67
64
68
- /*
69
- * The timer ID is turned into a timer address by idr_find().
70
- * Verifying a valid ID consists of:
71
- *
72
- * a) checking that idr_find() returns other than -1.
73
- * b) checking that the timer id matches the one in the timer itself.
74
- * c) that the timer owner is in the callers thread group.
75
- */
76
-
77
65
/*
78
66
* CLOCKs: The POSIX standard calls for a couple of clocks and allows us
79
67
* to implement others. This structure defines the various
0 commit comments