3535#include "timekeeping.h"
3636#include "posix-timers.h"
3737
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 ;
4639
4740/*
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.
4948 */
50- static struct kmem_cache * posix_timers_cache ;
51-
5249static DEFINE_HASHTABLE (posix_timers_hashtable , 9 ) ;
5350static DEFINE_SPINLOCK (hash_lock );
5451
@@ -65,15 +62,6 @@ static const struct k_clock clock_realtime, clock_monotonic;
6562#error "SIGEV_THREAD_ID must not share bit with other SIGEV values!"
6663#endif
6764
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-
7765/*
7866 * CLOCKs: The POSIX standard calls for a couple of clocks and allows us
7967 * to implement others. This structure defines the various
0 commit comments