linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mm: Add optional close() to struct vm_special_mapping
@ 2024-08-07 12:41 Michael Ellerman
  2024-08-07 12:41 ` [PATCH 2/4] powerpc/mm: Handle VDSO unmapping via close() rather than arch_unmap() Michael Ellerman
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Michael Ellerman @ 2024-08-07 12:41 UTC (permalink / raw)
  To: linux-mm
  Cc: linuxppc-dev, npiggin, linux-kernel, christophe.leroy, jeffxu,
	jeffxu, oliver.sang, Liam.Howlett, akpm, torvalds, pedro.falcato

Add an optional close() callback to struct vm_special_mapping. It will
be used, by powerpc at least, to handle unmapping of the VDSO.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 include/linux/mm_types.h | 2 ++
 mm/mmap.c                | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 485424979254..ef32d87a3adc 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1313,6 +1313,8 @@ struct vm_special_mapping {
 
 	int (*mremap)(const struct vm_special_mapping *sm,
 		     struct vm_area_struct *new_vma);
+	void (*close)(const struct vm_special_mapping *sm,
+		      struct vm_area_struct *vma);
 };
 
 enum tlb_flush_reason {
diff --git a/mm/mmap.c b/mm/mmap.c
index d0dfc85b209b..24bd6aa9155c 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3624,6 +3624,9 @@ static vm_fault_t special_mapping_fault(struct vm_fault *vmf);
  */
 static void special_mapping_close(struct vm_area_struct *vma)
 {
+	const struct vm_special_mapping *sm = vma->vm_private_data;
+	if (sm->close)
+		sm->close(sm, vma);
 }
 
 static const char *special_mapping_name(struct vm_area_struct *vma)
-- 
2.45.2


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

end of thread, other threads:[~2024-08-12  8:23 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 12:41 [PATCH 1/4] mm: Add optional close() to struct vm_special_mapping Michael Ellerman
2024-08-07 12:41 ` [PATCH 2/4] powerpc/mm: Handle VDSO unmapping via close() rather than arch_unmap() Michael Ellerman
2024-08-07 15:33   ` David Hildenbrand
2024-08-07 15:43   ` Jeff Xu
2024-08-07 15:56     ` Liam R. Howlett
2024-08-07 16:36       ` Jeff Xu
2024-08-07 17:11         ` Liam R. Howlett
2024-08-07 20:11           ` Jeff Xu
2024-08-07 23:20             ` Liam R. Howlett
2024-08-08  3:21               ` Linus Torvalds
2024-08-08  3:36                 ` Jeff Xu
2024-08-08 18:08                   ` Liam R. Howlett
2024-08-08 18:36                     ` Jeff Xu
2024-08-08 18:46                       ` Liam R. Howlett
2024-08-08 18:52                         ` Jeff Xu
2024-08-08  4:18                 ` Jeff Xu
2024-08-08 16:15                 ` Liam R. Howlett
2024-08-07 12:41 ` [PATCH 3/4] mm: Remove arch_unmap() Michael Ellerman
2024-08-07 15:33   ` David Hildenbrand
2024-08-07 17:42   ` Thomas Gleixner
2024-08-07 12:41 ` [PATCH 4/4] powerpc/vdso: Refactor error handling Michael Ellerman
2024-08-07 15:32 ` [PATCH 1/4] mm: Add optional close() to struct vm_special_mapping David Hildenbrand
2024-08-12  8:23   ` Michael Ellerman
2024-08-07 15:52 ` Liam R. Howlett
2024-08-12  8:22   ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).