From 640ed448533a99aed9e30149855deb4f6e9c6218 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sun, 9 Feb 2020 16:24:29 -0800 Subject: [PATCH] simple_lmk: Report mm as freed as soon as exit_mmap() finishes exit_mmap() is responsible for freeing the vast majority of an mm's memory; in order to unblock Simple LMK faster, report an mm as freed as soon as exit_mmap() finishes. Signed-off-by: Sultan Alsawaf --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index ef651a322bf6..9d78fc2e9882 100755 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -983,6 +983,7 @@ static inline void __mmput(struct mm_struct *mm) ksm_exit(mm); khugepaged_exit(mm); /* must run before exit_mmap */ exit_mmap(mm); + simple_lmk_mm_freed(mm); mm_put_huge_zero_page(mm); set_mm_exe_file(mm, NULL); if (!list_empty(&mm->mmlist)) { @@ -992,7 +993,6 @@ static inline void __mmput(struct mm_struct *mm) } if (mm->binfmt) module_put(mm->binfmt->module); - simple_lmk_mm_freed(mm); mmdrop(mm); }