Skip to content

Commit 48286d5

Browse files
oleg-nesterovIngo Molnar
authored andcommitted
sched: Remove the obsolete exit_state/signal hacks
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>
1 parent c32b4fc commit 48286d5

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

kernel/sched_stats.h

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,7 @@ sched_info_switch(struct task_struct *prev, struct task_struct *next)
295295
static inline void account_group_user_time(struct task_struct *tsk,
296296
cputime_t cputime)
297297
{
298-
struct thread_group_cputimer *cputimer;
299-
300-
/* tsk == current, ensure it is safe to use ->signal */
301-
if (unlikely(tsk->exit_state))
302-
return;
303-
304-
cputimer = &tsk->signal->cputimer;
298+
struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
305299

306300
if (!cputimer->running)
307301
return;
@@ -325,13 +319,7 @@ static inline void account_group_user_time(struct task_struct *tsk,
325319
static inline void account_group_system_time(struct task_struct *tsk,
326320
cputime_t cputime)
327321
{
328-
struct thread_group_cputimer *cputimer;
329-
330-
/* tsk == current, ensure it is safe to use ->signal */
331-
if (unlikely(tsk->exit_state))
332-
return;
333-
334-
cputimer = &tsk->signal->cputimer;
322+
struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
335323

336324
if (!cputimer->running)
337325
return;
@@ -355,16 +343,7 @@ static inline void account_group_system_time(struct task_struct *tsk,
355343
static inline void account_group_exec_runtime(struct task_struct *tsk,
356344
unsigned long long ns)
357345
{
358-
struct thread_group_cputimer *cputimer;
359-
struct signal_struct *sig;
360-
361-
sig = tsk->signal;
362-
/* see __exit_signal()->task_rq_unlock_wait() */
363-
barrier();
364-
if (unlikely(!sig))
365-
return;
366-
367-
cputimer = &sig->cputimer;
346+
struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
368347

369348
if (!cputimer->running)
370349
return;

0 commit comments

Comments
 (0)