copy_signal() cleanup: clean thread_group_cputime_init()
authorVeaceslav Falico <vfalico@redhat.com>
Wed, 10 Mar 2010 23:23:03 +0000 (15:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Mar 2010 23:52:39 +0000 (15:52 -0800)
Remove unneeded initializations in thread_group_cputime_init() and in
posix_cpu_timers_init_group().  They are useless after kmem_cache_zalloc()
was used in copy_signal().

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/sched.h
kernel/fork.c

index 46c6f8d5dc06d2dce20f0f6f52e1884519403651..ca635c1284826d7b1ec8d2b754a4a80f28d05a28 100644 (file)
@@ -2391,9 +2391,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
 
 static inline void thread_group_cputime_init(struct signal_struct *sig)
 {
-       sig->cputimer.cputime = INIT_CPUTIME;
        spin_lock_init(&sig->cputimer.lock);
-       sig->cputimer.running = 0;
 }
 
 static inline void thread_group_cputime_free(struct signal_struct *sig)
index ce2666f84d8573e2fbb453c3d37603818d14df75..1beb6c303c416051e357e7e22637e29bffffcacc 100644 (file)
@@ -833,17 +833,6 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
        /* Thread group counters. */
        thread_group_cputime_init(sig);
 
-       /* Expiration times and increments. */
-       sig->it[CPUCLOCK_PROF].expires = cputime_zero;
-       sig->it[CPUCLOCK_PROF].incr = cputime_zero;
-       sig->it[CPUCLOCK_VIRT].expires = cputime_zero;
-       sig->it[CPUCLOCK_VIRT].incr = cputime_zero;
-
-       /* Cached expiration times. */
-       sig->cputime_expires.prof_exp = cputime_zero;
-       sig->cputime_expires.virt_exp = cputime_zero;
-       sig->cputime_expires.sched_exp = 0;
-
        cpu_limit = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
        if (cpu_limit != RLIM_INFINITY) {
                sig->cputime_expires.prof_exp = secs_to_cputime(cpu_limit);