lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 2 Apr 2009 23:13:36 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Jiri Pirko <jpirko@...hat.com>, kosaki.motohiro@...fujitsu.com,
	oleg@...hat.com, linux-kernel@...r.kernel.org, hugh@...itas.com,
	linux-mm@...ck.org
Subject: Re: [PATCH for -mm] getrusage: fill ru_maxrss value


* Andrew Morton <akpm@...ux-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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ