1. 12 Dec, 2008 2 commits
    • Oleg Nesterov's avatar
      posix-timers: check ->it_signal instead of ->it_pid to validate the timer · 89992102
      Oleg Nesterov authored
      Impact: clean up, speed up
      
      ->it_pid (was ->it_process) has also a special meaning: if it is NULL,
      the timer is under deletion or it wasn't initialized yet. We can check
      ->it_signal != NULL instead, this way we can
      
      	- simplify sys_timer_create() a bit
      
      	- remove yet another check from lock_timer()
      
      	- move put_pid(->it_pid) into release_posix_timer() which
      	  runs outside of ->it_lock
      Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      89992102
    • Oleg Nesterov's avatar
      posix-timers: use "struct pid*" instead of "struct task_struct*" · 27af4245
      Oleg Nesterov authored
      Impact: restructure, clean up code
      
      k_itimer holds the ref to the ->it_process until sys_timer_delete(). This
      allows to pin up to RLIMIT_SIGPENDING dead task_struct's. Change the code
      to use "struct pid *" instead.
      
      The patch doesn't kill ->it_process, it places ->it_pid into the union.
      ->it_process is still used by do_cpu_nanosleep() as before. It would be
      trivial to change the nanosleep code as well, but since it uses it_process
      in a special way I think it is better to keep this field for grep.
      
      The patch bloats the kernel by 104 bytes and it also adds the new pointer,
      ->it_signal, to k_itimer. It is used by lock_timer() to verify that the
      found timer was not created by another process. It is not clear why do we
      use the global database (and thus the global idr_lock) for posix timers.
      We still need the signal_struct->posix_timers which contains all useable
      timers, perhaps it is better to use some form of per-process array
      instead.
      Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      27af4245
  2. 11 Dec, 2008 1 commit
  3. 10 Dec, 2008 37 commits