lkml.org 
[lkml]   [2009]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH for -mm] getrusage: fill ru_maxrss value

* 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


\
 
 \ /
  Last update: 2009-04-02 23:17    [W:0.074 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site