From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Pirko <jpirko@redhat.com>,
kosaki.motohiro@jp.fujitsu.com, oleg@redhat.com,
linux-kernel@vger.kernel.org, hugh@veritas.com,
linux-mm@kvack.org
Subject: Re: [PATCH for -mm] getrusage: fill ru_maxrss value
Date: Thu, 2 Apr 2009 23:13:36 +0200 [thread overview]
Message-ID: <20090402211336.GB4076@elte.hu> (raw)
In-Reply-To: <20090402134738.43d87cb7.akpm@linux-foundation.org>
* Andrew Morton <akpm@linux-foundation.org> wrote:
> I have a note here that this patch needs acks, but I didn't note who
> from.
>
> Someone ack it :)
looks good to me at a quick glance. A stupid technicality. There's
repetitive patterns of:
> + if (current->mm) {
> + unsigned long hiwater_rss = get_mm_hiwater_rss(current->mm);
> +
> + if (sig->maxrss < hiwater_rss)
> + sig->maxrss = hiwater_rss;
> + }
in about 3 separate places. Wouldnt a helper along the lines of:
sig->maxrss = mm_hiwater_rss(current->mm, sig->maxrss);
be much more readable?
The helper could be something like:
static inline unsigned long
mm_hiwater_rss(struct mm_struct *mm, unsigned long maxrss)
{
return max(maxrss, mm ? get_mm_hiwater_rss(mm) : 0);
}
much nicer?
Ingo
--
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-02 21:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 11:15 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 [this message]
2009-04-05 8:49 ` Jiri Pirko
2009-04-05 17:24 ` Hugh Dickins
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=20090402211336.GB4076@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=hugh@veritas.com \
--cc=jpirko@redhat.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox