mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Frank van Maarseveen <frankvm@frankvm.com>
Cc: Christoph Lameter <clameter@engr.sgi.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.14-rc2] fix incorrect mm->hiwater_vm and mm->hiwater_rss
Date: Wed, 21 Sep 2005 16:35:56 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0509211621410.7001@goblin.wat.veritas.com> (raw)
In-Reply-To: <20050921145833.GA15682@janus>

On Wed, 21 Sep 2005, Frank van Maarseveen wrote:
> On Wed, Sep 21, 2005 at 03:38:57PM +0100, Hugh Dickins wrote:
> > On Wed, 21 Sep 2005, Frank van Maarseveen wrote:
> > > This fixes a post 2.6.11 regression in maintaining the mm->hiwater_* counters.
> > 
> > It would be a good idea to CC Christoph Lameter, who I believe was the
> > one who very intentionally moved most of these updates out to timer tick.
> > Is that significantly missing updates?
> 
> Apparently: I use a private patch (see below) to expose mm->hiwater_vm
> to userland via /proc to detect misbehaving processes and for measuring
> worst case memory use by programs. from 2.6.12 on I'm constantly seeing
> a lot of processes with hiwater_vm < total_vm.

Then just add an update_mem_hiwater() in your patch?  On one level,
of course, that's just a hack which will hide the deficiency from you.
But on another level, I suspect it'd be good enough.

Let's hear what Christoph has to say.

> > 5. Please add appropriate CONFIG, dummy macros etc., so that no time
> >    is wasted on these updates in all the vanilla systems which have no
> >    interest in them - but maybe Christoph already has that well in hand.
> 
> I'm not sure where it's being used for, other than how I use it in which
> case it probably should depend on CONFIG_PROC_FS:

CONFIG_FRANK_VM would be better.

> --- ./fs/proc/task_mmu.c.orig	2005-07-07 14:22:12.000000000 +0200
> +++ ./fs/proc/task_mmu.c	2005-09-16 13:51:56.000000000 +0200
> @@ -14,6 +14,7 @@
>  	text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK)) >> 10;
>  	lib = (mm->exec_vm << (PAGE_SHIFT-10)) - text;
>  	buffer += sprintf(buffer,
> +		"VmPeak:\t%8lu kB\n"

Good naming.

>  		"VmSize:\t%8lu kB\n"
>  		"VmLck:\t%8lu kB\n"
>  		"VmRSS:\t%8lu kB\n"
> @@ -22,6 +23,7 @@
>  		"VmExe:\t%8lu kB\n"
>  		"VmLib:\t%8lu kB\n"
>  		"VmPTE:\t%8lu kB\n",
> +		mm->hiwater_vm << (PAGE_SHIFT-10),
>  		(mm->total_vm - mm->reserved_vm) << (PAGE_SHIFT-10),
>  		mm->locked_vm << (PAGE_SHIFT-10),
>  		get_mm_counter(mm, rss) << (PAGE_SHIFT-10),

hiwater_vm would be much less contentious to update whenever total_vm
changes (perhaps in __vm_stat_account) than hiwater_rss.  But tomorrow
I fear we'll be seeing a /proc patch from Frank Rss...

I do keep wondering what's so interesting about this hiwater_vm
(but would regret proposing other statistics to gather instead):
perhaps you're showing it just because it's there?

Hugh

  reply	other threads:[~2005-09-21 15:36 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21 12:19 Frank van Maarseveen
2005-09-21 14:38 ` Hugh Dickins
2005-09-21 14:58   ` Frank van Maarseveen
2005-09-21 15:35     ` Hugh Dickins [this message]
2005-09-21 18:42       ` Frank van Maarseveen
2005-09-21 18:57         ` Hugh Dickins
2005-09-21 15:26   ` Christoph Lameter
2005-09-21 15:50     ` Frank van Maarseveen
2005-09-21 16:57   ` Jay Lan
2005-09-21 17:05     ` Christoph Lameter
2005-09-21 17:39       ` Jay Lan
2005-09-21 18:06         ` Frank van Maarseveen
2005-09-21 18:38           ` Jay Lan
2005-09-21 17:12     ` Hugh Dickins
2005-09-21 17:31       ` Jay Lan
2005-09-21 17:45         ` Christoph Lameter
2005-09-21 17:46         ` Hugh Dickins
2005-09-21 18:05           ` Jay Lan
2005-09-21 18:26             ` Frank van Maarseveen
2005-09-21 19:19               ` Hugh Dickins
2005-09-21 19:28                 ` Frank van Maarseveen
2005-09-21 19:38                   ` Jay Lan
2005-09-21 19:47                     ` Hugh Dickins
2005-09-21 19:48                     ` Frank van Maarseveen
2005-09-21 19:52                       ` Hugh Dickins
2005-09-21 19:48                 ` Christoph Lameter
2005-09-21 20:06                   ` Hugh Dickins
2005-09-21 20:13                     ` Christoph Lameter
2005-09-27 20:43                 ` Jay Lan
2005-09-27 21:47                   ` Jay Lan
2005-09-27 21:50                     ` Christoph Lameter
2005-09-27 22:43                       ` Jay Lan
2005-09-28 13:18                   ` Hugh Dickins
2005-09-28 17:31                     ` Jay Lan
2005-10-03 19:53                       ` Hugh Dickins
2005-10-04  8:59                         ` Frank van Maarseveen
2005-10-04 21:48                         ` Jay Lan
2005-10-07  2:09                           ` Jay Lan
2005-10-07  3:03                             ` Hugh Dickins

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=Pine.LNX.4.61.0509211621410.7001@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=clameter@engr.sgi.com \
    --cc=frankvm@frankvm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®