[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211111095008.264412-2-imbrenda@linux.ibm.com>
Date: Thu, 11 Nov 2021 10:50:04 +0100
From: Claudio Imbrenda <imbrenda@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linux-mm@...ck.org
Cc: thuth@...hat.com, frankja@...ux.ibm.com, borntraeger@...ibm.com,
Ulrich.Weigand@...ibm.com, heiko.carstens@...ibm.com,
david@...hat.com, ultrachin@....com, akpm@...ux-foundation.org,
vbabka@...e.cz, brookxu.cn@...il.com, xiaoggchen@...cent.com,
linuszeng@...cent.com, yihuilu@...cent.com, mhocko@...e.com,
daniel.m.jordan@...cle.com, axboe@...nel.dk, legion@...nel.org,
peterz@...radead.org, aarcange@...hat.com, christian@...uner.io,
ebiederm@...ssion.com, tglx@...utronix.de
Subject: [RFC v1 1/4] add arch mmput hook in exit.c
This simple patch adds a hook for the mmput in exit_mm. This allows
archs to perform the mmput in custom ways if desired (e.g.
asynchronously)
No functional change intended.
Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>
---
include/asm-generic/mmu_context.h | 4 ++++
kernel/exit.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/asm-generic/mmu_context.h b/include/asm-generic/mmu_context.h
index 91727065bacb..900931a6a105 100644
--- a/include/asm-generic/mmu_context.h
+++ b/include/asm-generic/mmu_context.h
@@ -73,4 +73,8 @@ static inline void deactivate_mm(struct task_struct *tsk,
}
#endif
+#ifndef arch_exit_mm_mmput
+#define arch_exit_mm_mmput mmput
+#endif
+
#endif /* __ASM_GENERIC_MMU_CONTEXT_H */
diff --git a/kernel/exit.c b/kernel/exit.c
index f702a6a63686..6eb1fdcc434e 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -504,7 +504,7 @@ static void exit_mm(void)
task_unlock(current);
mmap_read_unlock(mm);
mm_update_next_owner(mm);
- mmput(mm);
+ arch_exit_mm_mmput(mm);
if (test_thread_flag(TIF_MEMDIE))
exit_oom_victim();
}
--
2.31.1
Powered by blists - more mailing lists