summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2011-10-27 16:39:17 +0000
committeralc <alc@FreeBSD.org>2011-10-27 16:39:17 +0000
commit841afea2d9f7c1247e3fb6f7ea594619c4a067c0 (patch)
treedf4b3a31e6e696440d5b0fb21f80d8a64699e648 /sys/amd64
parent315841e3acfb0734bb338e0d4b4e13c891f900e8 (diff)
downloadFreeBSD-src-841afea2d9f7c1247e3fb6f7ea594619c4a067c0.zip
FreeBSD-src-841afea2d9f7c1247e3fb6f7ea594619c4a067c0.tar.gz
Eliminate vestiges of page coloring in VM_ALLOC_NOOBJ calls to
vm_page_alloc(). While I'm here, for the sake of consistency, always specify the allocation class, such as VM_ALLOC_NORMAL, as the first of the flags.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c9
-rw-r--r--sys/amd64/amd64/uma_machdep.c7
2 files changed, 6 insertions, 10 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 43df8ee..594f5c2 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -1635,7 +1635,6 @@ int
pmap_pinit(pmap_t pmap)
{
vm_page_t pml4pg;
- static vm_pindex_t color;
int i;
PMAP_LOCK_INIT(pmap);
@@ -1643,8 +1642,8 @@ pmap_pinit(pmap_t pmap)
/*
* allocate the page directory page
*/
- while ((pml4pg = vm_page_alloc(NULL, color++, VM_ALLOC_NOOBJ |
- VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL)
+ while ((pml4pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL |
+ VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL)
VM_WAIT;
pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml4pg));
@@ -2188,7 +2187,6 @@ get_pv_entry(pmap_t pmap, int try)
{
static const struct timeval printinterval = { 60, 0 };
static struct timeval lastprint;
- static vm_pindex_t colour;
struct vpgqueues *pq;
int bit, field;
pv_entry_t pv;
@@ -2228,7 +2226,7 @@ retry:
}
}
/* No free items, allocate another chunk */
- m = vm_page_alloc(NULL, colour, (pq == &vm_page_queues[PQ_ACTIVE] ?
+ m = vm_page_alloc(NULL, 0, (pq == &vm_page_queues[PQ_ACTIVE] ?
VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ |
VM_ALLOC_WIRED);
if (m == NULL) {
@@ -2255,7 +2253,6 @@ retry:
}
PV_STAT(pc_chunk_count++);
PV_STAT(pc_chunk_allocs++);
- colour++;
dump_add_page(m->phys_addr);
pc = (void *)PHYS_TO_DMAP(m->phys_addr);
pc->pc_pmap = pmap;
diff --git a/sys/amd64/amd64/uma_machdep.c b/sys/amd64/amd64/uma_machdep.c
index 1329668..3583975 100644
--- a/sys/amd64/amd64/uma_machdep.c
+++ b/sys/amd64/amd64/uma_machdep.c
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
void *
uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
{
- static vm_pindex_t colour;
vm_page_t m;
vm_paddr_t pa;
void *va;
@@ -50,13 +49,13 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
*flags = UMA_SLAB_PRIV;
if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
- pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
+ pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
else
- pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
+ pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
if (wait & M_ZERO)
pflags |= VM_ALLOC_ZERO;
for (;;) {
- m = vm_page_alloc(NULL, colour++, pflags | VM_ALLOC_NOOBJ);
+ m = vm_page_alloc(NULL, 0, pflags);
if (m == NULL) {
if (wait & M_NOWAIT)
return (NULL);
OpenPOWER on IntegriCloud