Skip to content

Commit 9de1581

Browse files
oleg-nesterovtorvalds
authored andcommitted
get_mm_hiwater_xxx: trivial, s/define/inline/
Andrew pointed out get_mm_hiwater_xxx() evaluate "mm" argument thrice/twice, make them inline. Signed-off-by: Oleg Nesterov <[email protected]> Cc: Hugh Dickins <[email protected]> Reviewed-by: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a12888f commit 9de1581

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

include/linux/sched.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,15 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
391391
(mm)->hiwater_vm = (mm)->total_vm; \
392392
} while (0)
393393

394-
#define get_mm_hiwater_rss(mm) max((mm)->hiwater_rss, get_mm_rss(mm))
395-
#define get_mm_hiwater_vm(mm) max((mm)->hiwater_vm, (mm)->total_vm)
394+
static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
395+
{
396+
return max(mm->hiwater_rss, get_mm_rss(mm));
397+
}
398+
399+
static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
400+
{
401+
return max(mm->hiwater_vm, mm->total_vm);
402+
}
396403

397404
extern void set_dumpable(struct mm_struct *mm, int value);
398405
extern int get_dumpable(struct mm_struct *mm);

0 commit comments

Comments
 (0)