Skip to content

Commit

Permalink
sched: Remove the obsolete exit_state/signal hacks
Browse files Browse the repository at this point in the history
account_group_xxx() functions check ->exit_state to ensure that
current->signal is valid and can't go away. This is not needed
since ea6d290, task->signal is pinned to task_struct.

The comment and another hack in account_group_exec_runtime() refers
to task_rq_unlock_wait() which was already removed by b7b8ff6.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100610230952.GA25914@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jun 18, 2010
1 parent c32b4fc commit 48286d5
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions kernel/sched_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,7 @@ sched_info_switch(struct task_struct *prev, struct task_struct *next)
static inline void account_group_user_time(struct task_struct *tsk,
cputime_t cputime)
{
struct thread_group_cputimer *cputimer;

/* tsk == current, ensure it is safe to use ->signal */
if (unlikely(tsk->exit_state))
return;

cputimer = &tsk->signal->cputimer;
struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;

if (!cputimer->running)
return;
Expand All @@ -325,13 +319,7 @@ static inline void account_group_user_time(struct task_struct *tsk,
static inline void account_group_system_time(struct task_struct *tsk,
cputime_t cputime)
{
struct thread_group_cputimer *cputimer;

/* tsk == current, ensure it is safe to use ->signal */
if (unlikely(tsk->exit_state))
return;

cputimer = &tsk->signal->cputimer;
struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;

if (!cputimer->running)
return;
Expand All @@ -355,16 +343,7 @@ static inline void account_group_system_time(struct task_struct *tsk,
static inline void account_group_exec_runtime(struct task_struct *tsk,
unsigned long long ns)
{
struct thread_group_cputimer *cputimer;
struct signal_struct *sig;

sig = tsk->signal;
/* see __exit_signal()->task_rq_unlock_wait() */
barrier();
if (unlikely(!sig))
return;

cputimer = &sig->cputimer;
struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;

if (!cputimer->running)
return;
Expand Down

0 comments on commit 48286d5

Please sign in to comment.