All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Jiri Pirko <jpirko@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] getrusage: fill ru_maxrss value
Date: Mon, 24 Nov 2008 19:00:31 +0100	[thread overview]
Message-ID: <20081124180031.GA20155@redhat.com> (raw)
In-Reply-To: <20081124170253.741d2e6e@psychotron.englab.brq.redhat.com>

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.


  reply	other threads:[~2008-11-24 18:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24 16:02 [PATCH] getrusage: fill ru_maxrss value Jiri Pirko
2008-11-24 18:00 ` Oleg Nesterov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-12-02 12:18 Jiri Pirko
2008-12-02 16:05 ` Oleg Nesterov
     [not found]   ` <20081202160507.GA14524-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-12-02 16:50     ` Michael Kerrisk
2008-12-02 16:50       ` Michael Kerrisk
2008-12-02 16:53   ` Jiri Pirko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081124180031.GA20155@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jpirko@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.