mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
alpha: fix vmalloc breakage
On alpha, we have to map some stuff in the VMALLOC space very early in the boot process (to make SRM console callbacks work and so on, see arch/alpha/mm/init.c). For old VM allocator, we just manually placed a vm_struct onto the global vmlist and this worked for ages. Unfortunately, the new allocator isn't aware of this, so it constantly tries to allocate the VM space which is already in use, making vmalloc on alpha defunct. This patch forces KVA to import vmlist entries on init. [[email protected]: remove unneeded check (per Johannes)] Signed-off-by: Ivan Kokshaysky <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b46578ed09
commit
822c18f2e3
1 changed files with 11 additions and 0 deletions
11
mm/vmalloc.c
11
mm/vmalloc.c
|
|
@ -24,6 +24,7 @@
|
|||
#include <linux/rbtree.h>
|
||||
#include <linux/radix-tree.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/bootmem.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
|
@ -984,6 +985,8 @@ EXPORT_SYMBOL(vm_map_ram);
|
|||
|
||||
void __init vmalloc_init(void)
|
||||
{
|
||||
struct vmap_area *va;
|
||||
struct vm_struct *tmp;
|
||||
int i;
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
|
|
@ -996,6 +999,14 @@ void __init vmalloc_init(void)
|
|||
vbq->nr_dirty = 0;
|
||||
}
|
||||
|
||||
/* Import existing vmlist entries. */
|
||||
for (tmp = vmlist; tmp; tmp = tmp->next) {
|
||||
va = alloc_bootmem(sizeof(struct vmap_area));
|
||||
va->flags = tmp->flags | VM_VM_AREA;
|
||||
va->va_start = (unsigned long)tmp->addr;
|
||||
va->va_end = va->va_start + tmp->size;
|
||||
__insert_vmap_area(va);
|
||||
}
|
||||
vmap_initialized = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue