From: Hugh Dickins <hugh@veritas.com>
To: Jiri Pirko <jpirko@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
kosaki.motohiro@jp.fujitsu.com, oleg@redhat.com,
linux-mm@kvack.org, mingo@elte.hu
Subject: Re: [PATCH for -mm] getrusage: fill ru_maxrss value
Date: Sun, 5 Apr 2009 18:24:22 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0904051736210.23536@blonde.anvils> (raw)
In-Reply-To: <20090405084902.GA4411@psychotron.englab.brq.redhat.com>
On Sun, 5 Apr 2009, Jiri Pirko wrote:
> (resend, repetitive patterns put into an inline function - not using max macro
> because it's was decided not to use it in previous conversation)
>
> From: Jiri Pirko <jpirko@redhat.com>
>
> Make ->ru_maxrss value in struct rusage filled accordingly to rss hiwater
> mark. This struct is filled as a parameter to getrusage syscall.
> ->ru_maxrss value is set to KBs which is the way it is done in BSD
> systems. /usr/bin/time (gnu time) application converts ->ru_maxrss to KBs
> which seems to be incorrect behavior. Maintainer of this util was
> notified by me with the patch which corrects it and cc'ed.
>
> To make this happen we extend struct signal_struct by two fields. The
> first one is ->maxrss which we use to store rss hiwater of the task. The
> second one is ->cmaxrss which we use to store highest rss hiwater of all
> task childs. These values are used in k_getrusage() to actually fill
> ->ru_maxrss. k_getrusage() uses current rss hiwater value directly if mm
> struct exists.
>
> Note:
> exec() clear mm->hiwater_rss, but doesn't clear sig->maxrss.
> it is intetionally behavior. *BSD getrusage have exec() inheriting.
Sorry, I'm finding myself quite unable to Ack this: that may well
be a measure of my density, rather than a criticism of your patch.
On the nitpicking level: I wish you'd put the args the other way
round in your setmax_mm_hiwater_rss(maxrss, mm): (mm, maxrss) would
be more conventional. Though we're gathering so many helpers for
these things, hard-to-distinguish without looking up in the header
file each time, that I wonder if they could all be refactored better.
But on the more serious level: I find I don't really understand what
this ru_maxrss number is supposed to be, so have a hard job telling
whether you've implemented it right (as to whether things are
updated in the right places, I'd rather rely on Oleg for that).
You convey the impression that it's supposed to be similar to
whatever it is in BSD, but little meaning beyond that. We agreed
before that it should be derived from hiwater_rss - though now I
google for "BSD getrusage" I find ru_maxrss described as "maximum
shared memory or current resident set", which leaves me thoroughly
confused.
I'm worrying particularly about the fork/exec issue you highlight.
You're exemplary in providing your test programs, but there's a big
omission: you don't mention that the first test, "./getrusage -lc",
gives a very different result on Linux than you say it does on BSD -
you say the BSD fork line is "fork: self 0 children 0", whereas
I find my Linux fork line is "fork: self 102636 children 0".
So after that discrepancy, I can't tell what to expect. Not that
I can make any sense of BSD's "self 0" there - I don't know how
you could present 0 there if this is related to hiwater_rss.
Now I'm seriously wondering if the ru_maxrss reported will generate
more bugreports from people puzzled as to how it should behave,
than help anyone in studying their process behaviour.
Sorry to be so negative after all this time: I genuinely hope others
will spring up to defend your patch and illustrate my stupidity.
Hugh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-04-05 17:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 11:15 [PATCH for -mm] getrusage: fill ru_maxrss value KOSAKI Motohiro
2008-12-31 10:08 ` Jiri Pirko
2008-12-31 12:42 ` KOSAKI Motohiro
2008-12-31 18:08 ` Jiri Pirko
2009-01-03 17:59 ` Oleg Nesterov
2009-01-03 21:13 ` KOSAKI Motohiro
2009-01-05 15:32 ` Jiri Pirko
2009-01-05 22:13 ` Andrew Morton
2009-01-06 9:48 ` Jiri Pirko
2009-04-02 20:47 ` Andrew Morton
2009-04-02 21:13 ` Ingo Molnar
2009-04-05 8:49 ` Jiri Pirko
2009-04-05 17:24 ` Hugh Dickins [this message]
2009-04-06 0:21 ` KOSAKI Motohiro
2009-04-06 7:22 ` Hugh Dickins
2009-06-17 20:21 ` Andrew Morton
2009-06-18 0:57 ` KOSAKI Motohiro
2009-09-07 2:58 ` KOSAKI Motohiro
2009-09-09 20:46 ` Andrew Morton
2009-09-09 23:17 ` KOSAKI Motohiro
2009-09-09 23:32 ` Andrew Morton
2009-09-09 23:37 ` KOSAKI Motohiro
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.64.0904051736210.23536@blonde.anvils \
--to=hugh@veritas.com \
--cc=akpm@linux-foundation.org \
--cc=jpirko@redhat.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).