All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hugh@veritas.com>, Jay Lan <jlan@sgi.com>,
	Jiri Pirko <jpirko@redhat.com>, Jonathan Lim <jlim@sgi.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH, RESEND] introduce get_mm_hiwater_xxx(), fix taskstats->hiwater_xxx accounting
Date: Sat, 13 Dec 2008 09:18:50 +0530	[thread overview]
Message-ID: <20081213034850.GE4365@balbir.in.ibm.com> (raw)
In-Reply-To: <2f11576a0812121834n4125d053xcc85a5aa87264b66@mail.gmail.com>

* KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2008-12-13 11:34:53]:

> > (changes: update the changelog/comments)
> >
> > xacct_add_tsk() relies on do_exit()->update_hiwater_xxx() and uses
> > mm->hiwater_xxx directly, this leads to 2 problems:
> >
> >        - taskstats_user_cmd() can call fill_pid()->xacct_add_tsk()
> >          at any moment before the task exits, so we should check the
> >          current values of rss/vm anyway.
> >
> >        - do_exit()->update_hiwater_xxx() calls are racy. An exiting
> >          thread can be preempted right before mm->hiwater_xxx = new_val,
> >          and another thread can use A_LOT of memory and exit in between.
> >          When the first thread resumes it can be the last thread in the
> >          thread group, in that case we report the wrong hiwater_xxx
> >          values which do not take A_LOT into account.
> >
> > Introduce get_mm_hiwater_rss() and get_mm_hiwater_vm() helpers and
> > change xacct_add_tsk() to use them. The first helper will also be
> > used by rusage->ru_maxrss accounting.
> >
> > Kill do_exit()->update_hiwater_xxx() calls. Unless we are going to
> > decrease rss/vm there is no point to update mm->hiwater_xxx, and
> > nobody can look at this mm_struct when exit_mmap() actually unmaps
> > the memory.
> >
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> 
> Thanks! looks good to me.
>    Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Me too, I am acking it, but you already have all the acks you need :)

Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>

-- 
	Balbir

  reply	other threads:[~2008-12-13  3:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12 14:05 [PATCH, RESEND] introduce get_mm_hiwater_xxx(), fix taskstats->hiwater_xxx accounting Oleg Nesterov
2008-12-12 15:56 ` Hugh Dickins
2008-12-13  2:34 ` KOSAKI Motohiro
2008-12-13  3:48   ` Balbir Singh [this message]
2008-12-16  0:21 ` Andrew Morton
2008-12-16 10:36   ` Oleg Nesterov
2008-12-16 10:43   ` 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=20081213034850.GE4365@balbir.in.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=jlan@sgi.com \
    --cc=jlim@sgi.com \
    --cc=jpirko@redhat.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    /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.