lkml.org 
[lkml]   [2008]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] getrusage: fill ru_maxrss value
On 11/24, Jiri Pirko wrote:
>
> @@ -1588,6 +1589,13 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
> accumulate_thread_rusage(t, r);
> t = next_thread(t);
> } while (t != p);
> + if (p->mm) {
> + update_hiwater_rss(p->mm);
> + if (r->ru_maxrss < p->mm->hiwater_rss)
> + r->ru_maxrss = p->mm->hiwater_rss;

The task can free its ->mm right after the check. You need get_task_mm(),
but you can't do this under ->siglock because it takes task_lock().

I think you can move this code outside of lock_task_sighand().

Oleg.



\
 
 \ /
  Last update: 2008-11-24 19:05    [W:0.092 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site