public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] get_mm_hiwater_xxx: trivial, s/define/inline/
@ 2009-01-18  3:39 Oleg Nesterov
  2009-01-23  3:21 ` KOSAKI Motohiro
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2009-01-18  3:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Hugh Dickins, linux-kernel

(sorry! forgot to save this patch)

Andrew pointed out get_mm_hiwater_xxx() evaluate "mm" argument thrice/twice,
make them inline.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>

--- K-28/include/linux/sched.h~CLEANUP	2008-12-03 18:17:18.000000000 +0100
+++ K-28/include/linux/sched.h	2008-12-20 16:01:31.000000000 +0100
@@ -388,8 +388,15 @@ extern void arch_unmap_area_topdown(stru
 		(mm)->hiwater_vm = (mm)->total_vm;	\
 } while (0)
 
-#define get_mm_hiwater_rss(mm)	max((mm)->hiwater_rss, get_mm_rss(mm))
-#define get_mm_hiwater_vm(mm)	max((mm)->hiwater_vm, (mm)->total_vm)
+static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
+{
+	return max(mm->hiwater_rss, get_mm_rss(mm));
+}
+
+static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
+{
+	return max(mm->hiwater_vm, mm->total_vm);
+}
 
 extern void set_dumpable(struct mm_struct *mm, int value);
 extern int get_dumpable(struct mm_struct *mm);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-23  3:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-18  3:39 [PATCH] get_mm_hiwater_xxx: trivial, s/define/inline/ Oleg Nesterov
2009-01-23  3:21 ` KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox