Skip to content

Commit 73f693c

Browse files
joergroedeltorvalds
authored andcommitted
mm: remove vmalloc_sync_(un)mappings()
These functions are not needed anymore because the vmalloc and ioremap mappings are now synchronized when they are created or torn down. Remove all callers and function definitions. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Steven Rostedt (VMware) <[email protected]> Acked-by: Andy Lutomirski <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Dave Hansen <[email protected]> Cc: "H . Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Michal Hocko <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vlastimil Babka <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 86cf69f commit 73f693c

File tree

7 files changed

+0
-91
lines changed

7 files changed

+0
-91
lines changed

arch/x86/mm/fault.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -214,26 +214,6 @@ void arch_sync_kernel_mappings(unsigned long start, unsigned long end)
214214
}
215215
}
216216

217-
static void vmalloc_sync(void)
218-
{
219-
unsigned long address;
220-
221-
if (SHARED_KERNEL_PMD)
222-
return;
223-
224-
arch_sync_kernel_mappings(VMALLOC_START, VMALLOC_END);
225-
}
226-
227-
void vmalloc_sync_mappings(void)
228-
{
229-
vmalloc_sync();
230-
}
231-
232-
void vmalloc_sync_unmappings(void)
233-
{
234-
vmalloc_sync();
235-
}
236-
237217
/*
238218
* 32-bit:
239219
*
@@ -336,23 +316,6 @@ static void dump_pagetable(unsigned long address)
336316

337317
#else /* CONFIG_X86_64: */
338318

339-
void vmalloc_sync_mappings(void)
340-
{
341-
/*
342-
* 64-bit mappings might allocate new p4d/pud pages
343-
* that need to be propagated to all tasks' PGDs.
344-
*/
345-
sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END);
346-
}
347-
348-
void vmalloc_sync_unmappings(void)
349-
{
350-
/*
351-
* Unmappings never allocate or free p4d/pud pages.
352-
* No work is required here.
353-
*/
354-
}
355-
356319
/*
357320
* 64-bit:
358321
*

drivers/acpi/apei/ghes.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@ int ghes_estatus_pool_init(int num_ghes)
167167
if (!addr)
168168
goto err_pool_alloc;
169169

170-
/*
171-
* New allocation must be visible in all pgd before it can be found by
172-
* an NMI allocating from the pool.
173-
*/
174-
vmalloc_sync_mappings();
175-
176170
rc = gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
177171
if (rc)
178172
goto err_pool_add;

include/linux/vmalloc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ extern int remap_vmalloc_range_partial(struct vm_area_struct *vma,
130130

131131
extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
132132
unsigned long pgoff);
133-
void vmalloc_sync_mappings(void);
134-
void vmalloc_sync_unmappings(void);
135133

136134
/*
137135
* Architectures can set this mask to a combination of PGTBL_P?D_MODIFIED values

kernel/notifier.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ NOKPROBE_SYMBOL(notify_die);
519519

520520
int register_die_notifier(struct notifier_block *nb)
521521
{
522-
vmalloc_sync_mappings();
523522
return atomic_notifier_chain_register(&die_chain, nb);
524523
}
525524
EXPORT_SYMBOL_GPL(register_die_notifier);

kernel/trace/trace.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8527,18 +8527,6 @@ static int allocate_trace_buffers(struct trace_array *tr, int size)
85278527
allocate_snapshot = false;
85288528
#endif
85298529

8530-
/*
8531-
* Because of some magic with the way alloc_percpu() works on
8532-
* x86_64, we need to synchronize the pgd of all the tables,
8533-
* otherwise the trace events that happen in x86_64 page fault
8534-
* handlers can't cope with accessing the chance that a
8535-
* alloc_percpu()'d memory might be touched in the page fault trace
8536-
* event. Oh, and we need to audit all other alloc_percpu() and vmalloc()
8537-
* calls in tracing, because something might get triggered within a
8538-
* page fault trace event!
8539-
*/
8540-
vmalloc_sync_mappings();
8541-
85428530
return 0;
85438531
}
85448532

mm/nommu.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -371,18 +371,6 @@ void vm_unmap_aliases(void)
371371
}
372372
EXPORT_SYMBOL_GPL(vm_unmap_aliases);
373373

374-
/*
375-
* Implement a stub for vmalloc_sync_[un]mapping() if the architecture
376-
* chose not to have one.
377-
*/
378-
void __weak vmalloc_sync_mappings(void)
379-
{
380-
}
381-
382-
void __weak vmalloc_sync_unmappings(void)
383-
{
384-
}
385-
386374
struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes)
387375
{
388376
BUG();

mm/vmalloc.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,12 +1353,6 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end)
13531353
if (unlikely(valist == NULL))
13541354
return false;
13551355

1356-
/*
1357-
* First make sure the mappings are removed from all page-tables
1358-
* before they are freed.
1359-
*/
1360-
vmalloc_sync_unmappings();
1361-
13621356
/*
13631357
* TODO: to calculate a flush range without looping.
13641358
* The list can be up to lazy_max_pages() elements.
@@ -3089,21 +3083,6 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
30893083
}
30903084
EXPORT_SYMBOL(remap_vmalloc_range);
30913085

3092-
/*
3093-
* Implement stubs for vmalloc_sync_[un]mappings () if the architecture chose
3094-
* not to have one.
3095-
*
3096-
* The purpose of this function is to make sure the vmalloc area
3097-
* mappings are identical in all page-tables in the system.
3098-
*/
3099-
void __weak vmalloc_sync_mappings(void)
3100-
{
3101-
}
3102-
3103-
void __weak vmalloc_sync_unmappings(void)
3104-
{
3105-
}
3106-
31073086
static int f(pte_t *pte, unsigned long addr, void *data)
31083087
{
31093088
pte_t ***p = data;

0 commit comments

Comments
 (0)