[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20081124180031.GA20155@redhat.com>
Date: Mon, 24 Nov 2008 19:00:31 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Jiri Pirko <jpirko@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists