ia64/linux-2.6.18-xen.hg

diff kernel/taskstats.c @ 240:3e8752eb6d9c

Apply patch for 2.6.18.8.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Oct 03 10:00:44 2007 +0100 (2007-10-03)
parents 831230e53067
children
line diff
     1.1 --- a/kernel/taskstats.c	Tue Oct 02 09:52:15 2007 +0100
     1.2 +++ b/kernel/taskstats.c	Wed Oct 03 10:00:44 2007 +0100
     1.3 @@ -229,14 +229,17 @@ static int fill_tgid(pid_t tgid, struct 
     1.4  	} else
     1.5  		get_task_struct(first);
     1.6  
     1.7 -	/* Start with stats from dead tasks */
     1.8 -	spin_lock_irqsave(&first->signal->stats_lock, flags);
     1.9 -	if (first->signal->stats)
    1.10 -		memcpy(stats, first->signal->stats, sizeof(*stats));
    1.11 -	spin_unlock_irqrestore(&first->signal->stats_lock, flags);
    1.12  
    1.13  	tsk = first;
    1.14  	read_lock(&tasklist_lock);
    1.15 +	/* Start with stats from dead tasks */
    1.16 +	if (first->signal) {
    1.17 +		spin_lock_irqsave(&first->signal->stats_lock, flags);
    1.18 +		if (first->signal->stats)
    1.19 +			memcpy(stats, first->signal->stats, sizeof(*stats));
    1.20 +		spin_unlock_irqrestore(&first->signal->stats_lock, flags);
    1.21 +	}
    1.22 +
    1.23  	do {
    1.24  		if (tsk->exit_state == EXIT_ZOMBIE && thread_group_leader(tsk))
    1.25  			continue;
    1.26 @@ -256,7 +259,7 @@ static int fill_tgid(pid_t tgid, struct 
    1.27  	 * Accounting subsytems can also add calls here to modify
    1.28  	 * fields of taskstats.
    1.29  	 */
    1.30 -
    1.31 +	put_task_struct(first);
    1.32  	return 0;
    1.33  }
    1.34