Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222869
b: refs/heads/master
c: 64141da
h: refs/heads/master
i:
  222867: 52a0a01
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Linus Torvalds committed Dec 2, 2010
1 parent c767ea8 commit ea7dbac
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 853ff88324a248a9f5da6e110850223db353ec07
refs/heads/master: 64141da587241301ce8638cc945f8b67853156ec
2 changes: 0 additions & 2 deletions trunk/arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2415,8 +2415,6 @@ void __init xen_init_mmu_ops(void)
x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done;
pv_mmu_ops = xen_mmu_ops;

vmap_lazy_unmap = false;

memset(dummy_mapping, 0xff, PAGE_SIZE);
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/vmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

struct vm_area_struct; /* vma defining user mapping in mm_types.h */

extern bool vmap_lazy_unmap;

/* bits in flags of vmalloc's vm_struct below */
#define VM_IOREMAP 0x00000001 /* ioremap() and friends */
#define VM_ALLOC 0x00000002 /* vmalloc() */
Expand Down
28 changes: 17 additions & 11 deletions trunk/mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include <asm/tlbflush.h>
#include <asm/shmparam.h>

bool vmap_lazy_unmap __read_mostly = true;

/*** Page table manipulation functions ***/

static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end)
Expand Down Expand Up @@ -503,9 +501,6 @@ static unsigned long lazy_max_pages(void)
{
unsigned int log;

if (!vmap_lazy_unmap)
return 0;

log = fls(num_online_cpus());

return log * (32UL * 1024 * 1024 / PAGE_SIZE);
Expand Down Expand Up @@ -566,7 +561,6 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
if (va->va_end > *end)
*end = va->va_end;
nr += (va->va_end - va->va_start) >> PAGE_SHIFT;
unmap_vmap_area(va);
list_add_tail(&va->purge_list, &valist);
va->flags |= VM_LAZY_FREEING;
va->flags &= ~VM_LAZY_FREE;
Expand Down Expand Up @@ -611,17 +605,28 @@ static void purge_vmap_area_lazy(void)
}

/*
* Free and unmap a vmap area, caller ensuring flush_cache_vunmap had been
* called for the correct range previously.
* Free a vmap area, caller ensuring that the area has been unmapped
* and flush_cache_vunmap had been called for the correct range
* previously.
*/
static void free_unmap_vmap_area_noflush(struct vmap_area *va)
static void free_vmap_area_noflush(struct vmap_area *va)
{
va->flags |= VM_LAZY_FREE;
atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy_nr);
if (unlikely(atomic_read(&vmap_lazy_nr) > lazy_max_pages()))
try_purge_vmap_area_lazy();
}

/*
* Free and unmap a vmap area, caller ensuring flush_cache_vunmap had been
* called for the correct range previously.
*/
static void free_unmap_vmap_area_noflush(struct vmap_area *va)
{
unmap_vmap_area(va);
free_vmap_area_noflush(va);
}

/*
* Free and unmap a vmap area
*/
Expand Down Expand Up @@ -798,7 +803,7 @@ static void free_vmap_block(struct vmap_block *vb)
spin_unlock(&vmap_block_tree_lock);
BUG_ON(tmp != vb);

free_unmap_vmap_area_noflush(vb->va);
free_vmap_area_noflush(vb->va);
call_rcu(&vb->rcu_head, rcu_free_vb);
}

Expand Down Expand Up @@ -936,6 +941,8 @@ static void vb_free(const void *addr, unsigned long size)
rcu_read_unlock();
BUG_ON(!vb);

vunmap_page_range((unsigned long)addr, (unsigned long)addr + size);

spin_lock(&vb->lock);
BUG_ON(bitmap_allocate_region(vb->dirty_map, offset >> PAGE_SHIFT, order));

Expand Down Expand Up @@ -988,7 +995,6 @@ void vm_unmap_aliases(void)

s = vb->va->va_start + (i << PAGE_SHIFT);
e = vb->va->va_start + (j << PAGE_SHIFT);
vunmap_page_range(s, e);
flush = 1;

if (s < start)
Expand Down

0 comments on commit ea7dbac

Please sign in to comment.