Messages in this thread | | | Date | Thu, 2 Apr 2009 23:13:36 +0200 | From | Ingo Molnar <> | Subject | Re: [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
| |