Merge jmallett@'s n64 work into HEAD - changeset 5

Remove unnecessary locking and sched_pin() call while creating a temporary
mapping.

Changes from http://svn.freebsd.org/base/user/jmallett/octeon

Approved by:	rrs (mentor), jmallett
This commit is contained in:
Jayachandran C. 2010-06-18 20:07:30 +00:00
parent 9e3e64e797
commit 89b6177335
2 changed files with 3 additions and 17 deletions

View file

@ -116,12 +116,6 @@ extern struct pmap kernel_pmap_store;
#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx)
#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx)
#define PMAP_LGMEM_LOCK_INIT(sysmap) mtx_init(&(sysmap)->lock, "pmap-lgmem", \
"per-cpu-map", (MTX_DEF| MTX_DUPOK))
#define PMAP_LGMEM_LOCK(sysmap) mtx_lock(&(sysmap)->lock)
#define PMAP_LGMEM_UNLOCK(sysmap) mtx_unlock(&(sysmap)->lock)
#define PMAP_LGMEM_DESTROY(sysmap) mtx_destroy(&(sysmap)->lock)
/*
* For each vm_page_t, there is a list of all currently valid virtual
* mappings of that page. An entry is a pv_entry_t, the list is pv_table.

View file

@ -195,7 +195,6 @@ static void *pmap_ptpgzone_allocf(uma_zone_t, int, u_int8_t *, int);
static uma_zone_t ptpgzone;
struct local_sysmaps {
struct mtx lock;
vm_offset_t base;
uint16_t valid1, valid2;
};
@ -214,11 +213,9 @@ static struct local_sysmaps sysmap_lmem[MAXCPU];
struct local_sysmaps *sysm; \
pt_entry_t *pte, npte; \
\
intr = intr_disable(); \
cpu = PCPU_GET(cpuid); \
sysm = &sysmap_lmem[cpu]; \
PMAP_LGMEM_LOCK(sysm); \
intr = intr_disable(); \
sched_pin(); \
va = sysm->base; \
npte = TLBLO_PA_TO_PFN(phys) | \
PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \
@ -231,11 +228,9 @@ static struct local_sysmaps sysmap_lmem[MAXCPU];
struct local_sysmaps *sysm; \
pt_entry_t *pte, npte; \
\
intr = intr_disable(); \
cpu = PCPU_GET(cpuid); \
sysm = &sysmap_lmem[cpu]; \
PMAP_LGMEM_LOCK(sysm); \
intr = intr_disable(); \
sched_pin(); \
va1 = sysm->base; \
va2 = sysm->base + PAGE_SIZE; \
npte = TLBLO_PA_TO_PFN(phys1) | \
@ -258,9 +253,7 @@ static struct local_sysmaps sysmap_lmem[MAXCPU];
*pte = PTE_G; \
tlb_invalidate_address(kernel_pmap, sysm->base + PAGE_SIZE); \
sysm->valid2 = 0; \
sched_unpin(); \
intr_restore(intr); \
PMAP_LGMEM_UNLOCK(sysm);
intr_restore(intr)
pd_entry_t
pmap_segmap(pmap_t pmap, vm_offset_t va)
@ -436,7 +429,6 @@ again:
sysmap_lmem[i].base = virtual_avail;
virtual_avail += PAGE_SIZE * 2;
sysmap_lmem[i].valid1 = sysmap_lmem[i].valid2 = 0;
PMAP_LGMEM_LOCK_INIT(&sysmap_lmem[i]);
}
}