Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119150
b: refs/heads/master
c: ad133ba
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Nov 17, 2008
1 parent 4a4efcd commit c1b83fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29d7b90c15035741d15421b36000509212b3e135
refs/heads/master: ad133ba3dc283300e5b62b5b7211d2f39fbf6ee7
7 changes: 5 additions & 2 deletions trunk/kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,9 +1308,10 @@ static inline int task_cputime_expired(const struct task_cputime *sample,
*/
static inline int fastpath_timer_check(struct task_struct *tsk)
{
struct signal_struct *sig = tsk->signal;
struct signal_struct *sig;

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

if (!task_cputime_zero(&tsk->cputime_expires)) {
Expand All @@ -1323,6 +1324,8 @@ static inline int fastpath_timer_check(struct task_struct *tsk)
if (task_cputime_expired(&task_sample, &tsk->cputime_expires))
return 1;
}

sig = tsk->signal;
if (!task_cputime_zero(&sig->cputime_expires)) {
struct task_cputime group_sample;

Expand Down
15 changes: 11 additions & 4 deletions trunk/kernel/sched_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,11 @@ static inline void account_group_user_time(struct task_struct *tsk,
{
struct signal_struct *sig;

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

sig = tsk->signal;
if (sig->cputime.totals) {
struct task_cputime *times;

Expand All @@ -325,9 +327,11 @@ static inline void account_group_system_time(struct task_struct *tsk,
{
struct signal_struct *sig;

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

sig = tsk->signal;
if (sig->cputime.totals) {
struct task_cputime *times;

Expand All @@ -353,8 +357,11 @@ static inline void account_group_exec_runtime(struct task_struct *tsk,
struct signal_struct *sig;

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

if (sig->cputime.totals) {
struct task_cputime *times;

Expand Down

0 comments on commit c1b83fa

Please sign in to comment.