Messages in this thread | | | Date | Mon, 24 Nov 2008 19:00:31 +0100 | From | Oleg Nesterov <> | Subject | Re: [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.
| |