timer fixes
Subsystems (3)
Linus,
Please pull the latest timers-fixes-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git timers-fixes-for-linus
Thanks,
Ingo
------------------>
Oleg Nesterov (2):
posix-timers: fix RLIMIT_CPU && fork()
posix-timers: fix RLIMIT_CPU && setitimer(CPUCLOCK_PROF)Randy Dunlap (1):
timers: add missing kernel-doc
kernel/fork.c | 13 +++++++++---- kernel/posix-cpu-timers.c | 2 +- kernel/timer.c | 7 +++++-- 3 files changed, 15 insertions(+), 7 deletions(-)
kernel/fork.c +9 -4
@@ -808,6 +808,12 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig) sig->cputime_expires.virt_exp = cputime_zero; sig->cputime_expires.sched_exp =0 ; +if (sig->rlim[RLIMIT_CPU ].rlim_cur !=RLIM_INFINITY ) { + sig->cputime_expires.prof_exp = +secs_to_cputime (sig->rlim[RLIMIT_CPU ].rlim_cur); + sig->cputimer.running =1 ; + } +/* The timer lists. */ INIT_LIST_HEAD (&sig->cpu_timers[0 ]);INIT_LIST_HEAD (&sig->cpu_timers[1 ]);
@@ -823,11 +829,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)atomic_inc (¤t->signal->live);return 0 ; } - sig =kmem_cache_alloc (signal_cachep,GFP_KERNEL ); - -if (sig) -posix_cpu_timers_init_group (sig); + sig =kmem_cache_alloc (signal_cachep,GFP_KERNEL ); tsk->signal = sig;if (!sig)return -ENOMEM ;
@@ -865,6 +868,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)memcpy (sig->rlim, current->signal->rlim,sizeof sig->rlim);task_unlock (current->group_leader); +posix_cpu_timers_init_group (sig); +acct_init_pacct (&sig->pacct);tty_audit_fork (sig);
kernel/posix-cpu-timers.c +1 -1
@@ -18,7 +18,7 @@ void update_rlimit_cpu(unsigned long rlim_new) cputime =secs_to_cputime (rlim_new);if (cputime_eq (current->signal->it_prof_expires, cputime_zero) || -cputime_lt (current->signal->it_prof_expires, cputime)) { +cputime_gt (current->signal->it_prof_expires, cputime)) {spin_lock_irq (¤t->sighand->siglock);set_process_cpu_timer (current,CPUCLOCK_PROF , &cputime,NULL );spin_unlock_irq (¤t->sighand->siglock);
kernel/timer.c +5 -2
@@ -524,10 +524,13 @@ static void __init_timer(struct timer_list *timer) }/** -* init_timer - initialize a timer. +* init_timer_key - initialize a timer * @timer: the timer to be initialized +* @name: name of the timer +* @key: lockdep class key of the fake lock used for tracking timer +* sync lock dependencies * -* init_timer() must be done to a timer prior calling *any* of the +* init_timer_key() must be done to a timer prior calling *any* of the * other timer functions. */ void init_timer (struct timer_list *timer)