On Mon, May 09, 2011 at 07:22:01PM +0100, Owain Ainsworth wrote: > The new world order of pmemrange makes this data completely redundant > (being dealt with by the pmemrange constraints instead). Remove all code > that messes with the freelist. > > While touching every caller of uvm_page_physload() anyway, add the flags > argument to all callers (all but one is 0 and that one already used > PHYSLOAD_DEVICE) and remove the macro magic to allow callers to continue > without it. > > Should shrink the code a bit, as well. > > My machine room is still in a mess, so this has only had the build > testing on i386 and amd64. I'd appreciate if people could check the > others since it'll be a while before I can get all my machines properly > set up. > > ok?
matthew@ kindly pointed out two cases there I had missed the flags addition. diff --git arch/alpha/alpha/machdep.c arch/alpha/alpha/machdep.c index 2a5a8de..216a681 100644 --- arch/alpha/alpha/machdep.c +++ arch/alpha/alpha/machdep.c @@ -559,7 +559,7 @@ nobootinfo: "0x%lx / 0x%lx\n", pfn0, kernstartpfn); #endif uvm_page_physload(pfn0, kernstartpfn, - pfn0, kernstartpfn, VM_FREELIST_DEFAULT); + pfn0, kernstartpfn, 0); } #ifdef _PMAP_MAY_USE_PROM_CONSOLE } @@ -573,7 +573,7 @@ nobootinfo: "0x%lx / 0x%lx\n", kernendpfn, pfn1); #endif uvm_page_physload(kernendpfn, pfn1, - kernendpfn, pfn1, VM_FREELIST_DEFAULT); + kernendpfn, pfn1, 0); } } else { /* @@ -583,8 +583,7 @@ nobootinfo: printf("Loading cluster %d: 0x%lx / 0x%lx\n", i, pfn0, pfn1); #endif - uvm_page_physload(pfn0, pfn1, pfn0, pfn1, - VM_FREELIST_DEFAULT); + uvm_page_physload(pfn0, pfn1, pfn0, pfn1, 0); } #ifdef _PMAP_MAY_USE_PROM_CONSOLE } diff --git arch/alpha/include/vmparam.h arch/alpha/include/vmparam.h index 24fb644..5ff1c06 100644 --- arch/alpha/include/vmparam.h +++ arch/alpha/include/vmparam.h @@ -125,9 +125,6 @@ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* no more after vm_mem_init */ -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - /* * pmap-specific data stored in the vm_physmem[] array. */ diff --git arch/amd64/amd64/machdep.c arch/amd64/amd64/machdep.c index 9ca1a7a..bc728a3 100644 --- arch/amd64/amd64/machdep.c +++ arch/amd64/amd64/machdep.c @@ -1360,7 +1360,6 @@ init_x86_64(paddr_t first_avail) for (x = 0; x < mem_cluster_cnt; x++) { paddr_t seg_start = mem_clusters[x].start; paddr_t seg_end = seg_start + mem_clusters[x].size; - int seg_type; if (seg_start < first_avail) seg_start = first_avail; if (seg_start > seg_end) continue; @@ -1368,20 +1367,12 @@ init_x86_64(paddr_t first_avail) physmem += atop(mem_clusters[x].size); - /* XXX - Should deal with 4GB boundary */ - if (seg_start >= (1UL<<32)) - seg_type = VM_FREELIST_HIGH; - else if (seg_end <= 16*1024*1024) - seg_type = VM_FREELIST_LOW; - else - seg_type = VM_FREELIST_DEFAULT; - #if DEBUG_MEMLOAD printf("loading 0x%lx-0x%lx (0x%lx-0x%lx)\n", seg_start, seg_end, atop(seg_start), atop(seg_end)); #endif uvm_page_physload(atop(seg_start), atop(seg_end), - atop(seg_start), atop(seg_end), seg_type); + atop(seg_start), atop(seg_end), 0); } #if DEBUG_MEMLOAD printf("avail_start = 0x%lx\n", avail_start); diff --git arch/amd64/include/vmparam.h arch/amd64/include/vmparam.h index 494416f..bc22bac 100644 --- arch/amd64/include/vmparam.h +++ arch/amd64/include/vmparam.h @@ -110,11 +110,6 @@ #define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ -#define VM_NFREELIST 3 -#define VM_FREELIST_DEFAULT 0 -#define VM_FREELIST_LOW 1 -#define VM_FREELIST_HIGH 2 - #define __HAVE_VM_PAGE_MD struct pv_entry; struct vm_page_md { diff --git arch/armish/armish/armish_machdep.c arch/armish/armish/armish_machdep.c index d8ac7f6..850694f 100644 --- arch/armish/armish/armish_machdep.c +++ arch/armish/armish/armish_machdep.c @@ -750,8 +750,7 @@ initarm(void *arg) #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ uvm_page_physload(atop(physical_freestart), atop(physical_freeend), - atop(physical_freestart), atop(physical_freeend), - VM_FREELIST_DEFAULT); + atop(physical_freestart), atop(physical_freeend), 0); /* Boot strap pmap telling it where the kernel page table is */ #ifdef VERBOSE_INIT_ARM diff --git arch/armish/include/vmparam.h arch/armish/include/vmparam.h index 6e955c6..9547898 100644 --- arch/armish/include/vmparam.h +++ arch/armish/include/vmparam.h @@ -93,8 +93,4 @@ */ #endif /* _KERNEL */ -#define VM_NFREELIST 2 -#define VM_FREELIST_DEFAULT 0 - - #endif /* _MACHINE_VMPARAM_H_ */ diff --git arch/aviion/aviion/machdep.c arch/aviion/aviion/machdep.c index c26b33b..4f078f6 100644 --- arch/aviion/aviion/machdep.c +++ arch/aviion/aviion/machdep.c @@ -757,7 +757,7 @@ aviion_bootstrap() * XXX so we will need to upload two ranges of pages on them. */ uvm_page_physload(atop(avail_start), atop(avail_end), - atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); + atop(avail_start), atop(avail_end), 0); /* * Initialize message buffer. diff --git arch/beagle/beagle/beagle_machdep.c arch/beagle/beagle/beagle_machdep.c index d19cde7..c87ddcd 100644 --- arch/beagle/beagle/beagle_machdep.c +++ arch/beagle/beagle/beagle_machdep.c @@ -887,8 +887,7 @@ initarm(void *arg) #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ uvm_page_physload(atop(physical_freestart), atop(physical_freeend), - atop(physical_freestart), atop(physical_freeend), - VM_FREELIST_DEFAULT); + atop(physical_freestart), atop(physical_freeend), 0); /* Boot strap pmap telling it where the kernel page table is */ #ifdef VERBOSE_INIT_ARM diff --git arch/beagle/include/vmparam.h arch/beagle/include/vmparam.h index 6de61a5..cad31a8 100644 --- arch/beagle/include/vmparam.h +++ arch/beagle/include/vmparam.h @@ -85,16 +85,6 @@ #define VM_PHYSSEG_NOADD -/* - * we support 2 free lists: - * - * - DEFAULT for all systems - * - ISADMA for the ISA DMA range on Sharks only - */ #endif /* _KERNEL */ -#define VM_NFREELIST 2 -#define VM_FREELIST_DEFAULT 0 - - #endif /* _MACHINE_VMPARAM_H_ */ diff --git arch/gumstix/gumstix/gumstix_machdep.c arch/gumstix/gumstix/gumstix_machdep.c index 8f13f1c..d9789ea 100644 --- arch/gumstix/gumstix/gumstix_machdep.c +++ arch/gumstix/gumstix/gumstix_machdep.c @@ -1021,8 +1021,7 @@ initarm(void *arg) #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ uvm_page_physload(atop(physical_freestart), atop(physical_freeend), - atop(physical_freestart), atop(physical_freeend), - VM_FREELIST_DEFAULT); + atop(physical_freestart), atop(physical_freeend), 0); /* Boot strap pmap telling it where the kernel page table is */ #ifdef VERBOSE_INIT_ARM diff --git arch/gumstix/include/vmparam.h arch/gumstix/include/vmparam.h index 3352e71..5fcf3b7 100644 --- arch/gumstix/include/vmparam.h +++ arch/gumstix/include/vmparam.h @@ -79,8 +79,5 @@ #endif /* _KERNEL */ -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #endif /* _MACHINE_VMPARAM_H_ */ diff --git arch/hp300/hp300/machdep.c arch/hp300/hp300/machdep.c index cf372aa..f4e81e4 100644 --- arch/hp300/hp300/machdep.c +++ arch/hp300/hp300/machdep.c @@ -177,7 +177,7 @@ hp300_init() * hp300 only has one segment. */ uvm_page_physload(atop(avail_start), atop(avail_end), - atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); + atop(avail_start), atop(avail_end), 0); /* Initialize the interrupt handlers. */ intr_init(); diff --git arch/hppa/hppa/pmap.c arch/hppa/hppa/pmap.c index bd25f96..f151c78 100644 --- arch/hppa/hppa/pmap.c +++ arch/hppa/hppa/pmap.c @@ -587,8 +587,7 @@ pmap_bootstrap(vstart) resvphysmem = atop(addr); eaddr = physmem - atop(round_page(MSGBUFSIZE)); DPRINTF(PDB_INIT, ("physmem: 0x%x - 0x%x\n", resvphysmem, eaddr)); - uvm_page_physload(0, eaddr, - resvphysmem, eaddr, VM_FREELIST_DEFAULT); + uvm_page_physload(0, eaddr, resvphysmem, eaddr, 0); /* TODO optimize/inline the kenter */ for (va = 0; va < ptoa(physmem); va += PAGE_SIZE) { diff --git arch/hppa/include/vmparam.h arch/hppa/include/vmparam.h index bd11ff4..5c6fc85 100644 --- arch/hppa/include/vmparam.h +++ arch/hppa/include/vmparam.h @@ -92,10 +92,6 @@ #define VM_PHYSSEG_NOADD /* XXX until uvm code is fixed */ -#define VM_NFREELIST 2 -#define VM_FREELIST_DEFAULT 0 -#define VM_FREELIST_ARCH 1 - #if defined(_KERNEL) && !defined(_LOCORE) #include <sys/lock.h> diff --git arch/hppa64/hppa64/pmap.c arch/hppa64/hppa64/pmap.c index 829b3a4..1bb084f 100644 --- arch/hppa64/hppa64/pmap.c +++ arch/hppa64/hppa64/pmap.c @@ -528,8 +528,7 @@ pmap_bootstrap(vaddr_t vstart) eaddr = physmem - atop(round_page(MSGBUFSIZE)); resvphysmem = atop(addr); DPRINTF(PDB_INIT, ("physmem: 0x%lx - 0x%lx\n", resvphysmem, eaddr)); - uvm_page_physload(0, physmem, - resvphysmem, eaddr, VM_FREELIST_DEFAULT); + uvm_page_physload(0, physmem, resvphysmem, eaddr, 0); } void diff --git arch/hppa64/include/vmparam.h arch/hppa64/include/vmparam.h index 9a24059..78eeb32 100644 --- arch/hppa64/include/vmparam.h +++ arch/hppa64/include/vmparam.h @@ -87,10 +87,6 @@ #define VM_PHYSSEG_NOADD /* XXX until uvm code is fixed */ -#define VM_NFREELIST 2 -#define VM_FREELIST_DEFAULT 0 -#define VM_FREELIST_ARCH 1 - #if defined(_KERNEL) && !defined(_LOCORE) #include <sys/lock.h> diff --git arch/i386/i386/machdep.c arch/i386/i386/machdep.c index 67ef48c..241a090 100644 --- arch/i386/i386/machdep.c +++ arch/i386/i386/machdep.c @@ -3140,12 +3140,11 @@ init386(paddr_t first_avail) #ifdef DEBUG printf(" %x-%x (<16M)", lim, kb); #endif - uvm_page_physload(lim, kb, lim, kb, VM_FREELIST_FIRST16); + uvm_page_physload(lim, kb, lim, kb, 0); } for (i = 0; i < ndumpmem; i++) { paddr_t a, e; - paddr_t lim; a = dumpmem[i].start; e = dumpmem[i].end; @@ -3155,27 +3154,10 @@ init386(paddr_t first_avail) e = atop(avail_end); if (a < e) { - if (a < atop(16 * 1024 * 1024)) { - lim = MIN(atop(16 * 1024 * 1024), e); -#ifdef DEBUG - printf(" %x-%x (<16M)", a, lim); -#endif - uvm_page_physload(a, lim, a, lim, - VM_FREELIST_FIRST16); - if (e > lim) { -#ifdef DEBUG - printf(" %x-%x", lim, e); -#endif - uvm_page_physload(lim, e, lim, e, - VM_FREELIST_DEFAULT); - } - } else { #ifdef DEBUG printf(" %x-%x", a, e); #endif - uvm_page_physload(a, e, a, e, - VM_FREELIST_DEFAULT); - } + uvm_page_physload(a, e, a, e, 0); } } #ifdef DEBUG diff --git arch/i386/include/vmparam.h arch/i386/include/vmparam.h index ebbf1c3..cf2a5a9 100644 --- arch/i386/include/vmparam.h +++ arch/i386/include/vmparam.h @@ -117,10 +117,6 @@ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ -#define VM_NFREELIST 2 -#define VM_FREELIST_DEFAULT 0 -#define VM_FREELIST_FIRST16 1 - #define __HAVE_VM_PAGE_MD struct pv_entry; struct vm_page_md { diff --git arch/landisk/include/vmparam.h arch/landisk/include/vmparam.h index 2748383..5b2c9e6 100644 --- arch/landisk/include/vmparam.h +++ arch/landisk/include/vmparam.h @@ -12,7 +12,4 @@ #define VM_PHYSSEG_NOADD #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #endif /* _MACHINE_VMPARAM_H_ */ diff --git arch/landisk/landisk/machdep.c arch/landisk/landisk/machdep.c index 2d59e59..96c4009 100644 --- arch/landisk/landisk/machdep.c +++ arch/landisk/landisk/machdep.c @@ -163,7 +163,7 @@ landisk_startup(int howto, char *_esym) kernend = atop(round_page(SH3_P1SEG_TO_PHYS(kernend))); uvm_page_physload(atop(IOM_RAM_BEGIN), atop(IOM_RAM_BEGIN + ramsize), kernend, - atop(IOM_RAM_BEGIN + ramsize), VM_FREELIST_DEFAULT); + atop(IOM_RAM_BEGIN + ramsize), 0); cpu_init_kcore_hdr(); /* need to be done before pmap_bootstrap */ /* Initialize proc0 u-area */ diff --git arch/loongson/loongson/machdep.c arch/loongson/loongson/machdep.c index 256e825..46f3306 100644 --- arch/loongson/loongson/machdep.c +++ arch/loongson/loongson/machdep.c @@ -449,7 +449,6 @@ mips_init(int32_t argc, int32_t argv, int32_t envp, int32_t cv, for (i = 0; i < MAXMEMSEGS && mem_layout[i].mem_last_page != 0; i++) { uint64_t fp, lp; uint64_t firstkernpage, lastkernpage; - unsigned int freelist; paddr_t firstkernpa, lastkernpa; /* kernel is linked in CKSEG0 */ @@ -463,14 +462,13 @@ mips_init(int32_t argc, int32_t argv, int32_t envp, int32_t cv, fp = mem_layout[i].mem_first_page; lp = mem_layout[i].mem_last_page; - freelist = mem_layout[i].mem_freelist; /* Account for kernel and kernel symbol table. */ if (fp >= firstkernpage && lp < lastkernpage) continue; /* In kernel. */ if (lp < firstkernpage || fp > lastkernpage) { - uvm_page_physload(fp, lp, fp, lp, freelist); + uvm_page_physload(fp, lp, fp, lp, 0); continue; /* Outside kernel. */ } @@ -480,11 +478,11 @@ mips_init(int32_t argc, int32_t argv, int32_t envp, int32_t cv, lp = firstkernpage; else { /* Need to split! */ uint64_t xp = firstkernpage; - uvm_page_physload(fp, xp, fp, xp, freelist); + uvm_page_physload(fp, xp, fp, xp, 0); fp = lastkernpage; } if (lp > fp) { - uvm_page_physload(fp, lp, fp, lp, freelist); + uvm_page_physload(fp, lp, fp, lp, 0); } } diff --git arch/luna88k/luna88k/machdep.c arch/luna88k/luna88k/machdep.c index e74bb9a..7d58faa 100644 --- arch/luna88k/luna88k/machdep.c +++ arch/luna88k/luna88k/machdep.c @@ -960,7 +960,7 @@ luna88k_bootstrap() * luna88k only has one segment. */ uvm_page_physload(atop(avail_start), atop(avail_end), - atop(avail_start), atop(avail_end),VM_FREELIST_DEFAULT); + atop(avail_start), atop(avail_end), 0); /* * Initialize message buffer. diff --git arch/m68k/include/vmparam.h arch/m68k/include/vmparam.h index 2d7259a..93848e7 100644 --- arch/m68k/include/vmparam.h +++ arch/m68k/include/vmparam.h @@ -114,9 +114,6 @@ */ #define VM_PHYSSEG_NOADD -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #ifndef _LOCORE #include <machine/pte.h> /* st_entry_t */ diff --git arch/m88k/include/vmparam.h arch/m88k/include/vmparam.h index c08c5b7..4935b53 100644 --- arch/m88k/include/vmparam.h +++ arch/m88k/include/vmparam.h @@ -86,9 +86,6 @@ #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM #define VM_PHYSSEG_NOADD -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #ifndef _LOCORE /* * pmap-specific data stored in the vm_physmem[] array. diff --git arch/mac68k/mac68k/machdep.c arch/mac68k/mac68k/machdep.c index a79b571..d8b2e15 100644 --- arch/mac68k/mac68k/machdep.c +++ arch/mac68k/mac68k/machdep.c @@ -245,12 +245,10 @@ mac68k_init() for (i = 0; i < numranges; i++) { if (low[i] <= avail_start && avail_start < high[i]) uvm_page_physload(atop(avail_start), atop(high[i]), - atop(avail_start), atop(high[i]), - VM_FREELIST_DEFAULT); + atop(avail_start), atop(high[i]), 0); else uvm_page_physload(atop(low[i]), atop(high[i]), - atop(low[i]), atop(high[i]), - VM_FREELIST_DEFAULT); + atop(low[i]), atop(high[i]), 0); } /* diff --git arch/macppc/include/vmparam.h arch/macppc/include/vmparam.h index 41b9056..9059cc8 100644 --- arch/macppc/include/vmparam.h +++ arch/macppc/include/vmparam.h @@ -101,9 +101,6 @@ extern vaddr_t ppc_kvm_stolen; #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #ifdef _KERNEL #define __HAVE_VM_PAGE_MD diff --git arch/mips64/include/memconf.h arch/mips64/include/memconf.h index e65d53a..71d7351 100644 --- arch/mips64/include/memconf.h +++ arch/mips64/include/memconf.h @@ -35,7 +35,6 @@ struct phys_mem_desc { uint64_t mem_first_page; uint64_t mem_last_page; - unsigned int mem_freelist; }; #ifdef _KERNEL @@ -43,7 +42,7 @@ struct phys_mem_desc { #define MAXMEMSEGS 16 #endif extern struct phys_mem_desc mem_layout[]; -int memrange_register(uint64_t, uint64_t, uint64_t, unsigned int); +int memrange_register(uint64_t, uint64_t, uint64_t); #endif #endif /* !_MIPS64_MEMCONF_H_ */ diff --git arch/mips64/include/vmparam.h arch/mips64/include/vmparam.h index 1e8fc99..6579e2e 100644 --- arch/mips64/include/vmparam.h +++ arch/mips64/include/vmparam.h @@ -106,11 +106,6 @@ #define VM_PIE_MIN_ADDR PAGE_SIZE #define VM_PIE_MAX_ADDR (0x10000000UL) -#ifndef VM_NFREELIST -#define VM_NFREELIST 1 -#endif -#define VM_FREELIST_DEFAULT 0 - /* virtual sizes (bytes) for various kernel submaps */ #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) diff --git arch/mips64/mips64/arcbios.c arch/mips64/mips64/arcbios.c index 1e82a4e..ce8f8ad 100644 --- arch/mips64/mips64/arcbios.c +++ arch/mips64/mips64/arcbios.c @@ -365,8 +365,7 @@ bios_configure_memory() break; } if (seg_start < seg_end) - memrange_register(seg_start, seg_end, 0, - VM_FREELIST_DEFAULT); + memrange_register(seg_start, seg_end, 0); break; case ExceptionBlock: case SystemParameterBlock: diff --git arch/mvme68k/mvme68k/machdep.c arch/mvme68k/mvme68k/machdep.c index 2d76d92..1a5b7ed 100644 --- arch/mvme68k/mvme68k/machdep.c +++ arch/mvme68k/mvme68k/machdep.c @@ -177,7 +177,7 @@ mvme68k_init() uvmexp.pagesize = NBPG; uvm_setpagesize(); uvm_page_physload(atop(avail_start), atop(avail_end), - atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); + atop(avail_start), atop(avail_end), 0); /* * Put machine specific exception vectors in place. diff --git arch/mvme88k/mvme88k/machdep.c arch/mvme88k/mvme88k/machdep.c index 551d238..a3f51b3 100644 --- arch/mvme88k/mvme88k/machdep.c +++ arch/mvme88k/mvme88k/machdep.c @@ -990,7 +990,7 @@ mvme_bootstrap() * might want to register ECC memory separately later on... */ uvm_page_physload(atop(avail_start), atop(avail_end), - atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); + atop(avail_start), atop(avail_end), 0); /* * Initialize message buffer. diff --git arch/mvmeppc/include/vmparam.h arch/mvmeppc/include/vmparam.h index 453a1d2..be9fa35 100644 --- arch/mvmeppc/include/vmparam.h +++ arch/mvmeppc/include/vmparam.h @@ -104,7 +104,4 @@ struct pmap_physseg { #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #endif diff --git arch/octeon/octeon/machdep.c arch/octeon/octeon/machdep.c index 358a505..0e7127b 100644 --- arch/octeon/octeon/machdep.c +++ arch/octeon/octeon/machdep.c @@ -227,7 +227,6 @@ octeon_memory_init(struct boot_info *boot_info) endpfn = atop(96 << 20); mem_layout[0].mem_first_page = startpfn; mem_layout[0].mem_last_page = endpfn; - mem_layout[0].mem_freelist = VM_FREELIST_DEFAULT; physmem = endpfn - startpfn; @@ -281,7 +280,6 @@ octeon_memory_init(struct boot_info *boot_info) physmem += btoc(phys_avail[3] - phys_avail[2]); mem_layout[2].mem_first_page = atop(phys_avail[2]); mem_layout[2].mem_last_page = atop(phys_avail[3]-1); - mem_layout[2].mem_freelist = VM_FREELIST_DEFAULT; #endif realmem_bytes -= OCTEON_DRAM_FIRST_256_END; @@ -291,7 +289,6 @@ octeon_memory_init(struct boot_info *boot_info) physmem += btoc(phys_avail[5] - phys_avail[4]); mem_layout[1].mem_first_page = atop(phys_avail[4]); mem_layout[1].mem_last_page = atop(phys_avail[5]-1); - mem_layout[1].mem_freelist = VM_FREELIST_DEFAULT; realmem_bytes=0; }else{ #if 0 /* XXX: need fix on mips64 pmap code */ @@ -301,7 +298,6 @@ octeon_memory_init(struct boot_info *boot_info) physmem += btoc(phys_avail[3] - phys_avail[2]); mem_layout[1].mem_first_page = atop(phys_avail[2]); mem_layout[1].mem_last_page = atop(phys_avail[3]-1); - mem_layout[1].mem_freelist = VM_FREELIST_DEFAULT; realmem_bytes=0; #endif } @@ -403,7 +399,6 @@ mips_init(__register_t a0, __register_t a1, __register_t a2 __unused, for (i = 0; i < MAXMEMSEGS && mem_layout[i].mem_last_page != 0; i++) { uint64_t fp, lp; uint64_t firstkernpage, lastkernpage; - unsigned int freelist; paddr_t firstkernpa, lastkernpa; /* kernel is linked in CKSEG0 */ @@ -415,14 +410,13 @@ mips_init(__register_t a0, __register_t a1, __register_t a2 __unused, fp = mem_layout[i].mem_first_page; lp = mem_layout[i].mem_last_page; - freelist = mem_layout[i].mem_freelist; /* Account for kernel and kernel symbol table. */ if (fp >= firstkernpage && lp < lastkernpage) continue; /* In kernel. */ if (lp < firstkernpage || fp > lastkernpage) { - uvm_page_physload(fp, lp, fp, lp, freelist); + uvm_page_physload(fp, lp, fp, lp, 0); continue; /* Outside kernel. */ } @@ -432,11 +426,11 @@ mips_init(__register_t a0, __register_t a1, __register_t a2 __unused, lp = firstkernpage; else { /* Need to split! */ uint64_t xp = firstkernpage; - uvm_page_physload(fp, xp, fp, xp, freelist); + uvm_page_physload(fp, xp, fp, xp, 0); fp = lastkernpage; } if (lp > fp) { - uvm_page_physload(fp, lp, fp, lp, freelist); + uvm_page_physload(fp, lp, fp, lp, 0); } } diff --git arch/palm/include/vmparam.h arch/palm/include/vmparam.h index 3352e71..6b74069 100644 --- arch/palm/include/vmparam.h +++ arch/palm/include/vmparam.h @@ -79,8 +79,4 @@ #endif /* _KERNEL */ -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - - #endif /* _MACHINE_VMPARAM_H_ */ diff --git arch/palm/palm/palm_machdep.c arch/palm/palm/palm_machdep.c index a813b4b..09c6fe0 100644 --- arch/palm/palm/palm_machdep.c +++ arch/palm/palm/palm_machdep.c @@ -1051,8 +1051,7 @@ initarm(void *arg) #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ uvm_page_physload(atop(physical_freestart), atop(physical_freeend), - atop(physical_freestart), atop(physical_freeend), - VM_FREELIST_DEFAULT); + atop(physical_freestart), atop(physical_freeend), 0); /* Boot strap pmap telling it where the kernel page table is */ #ifdef VERBOSE_INIT_ARM diff --git arch/powerpc/powerpc/pmap.c arch/powerpc/powerpc/pmap.c index b6da286..eb8d398 100644 --- arch/powerpc/powerpc/pmap.c +++ arch/powerpc/powerpc/pmap.c @@ -1748,8 +1748,7 @@ pmap_bootstrap(u_int kernelstart, u_int kernelend) if (mp->start + mp->size > 0x80000000) mp->size = 0x80000000 - mp->start; uvm_page_physload(atop(mp->start), atop(mp->start+mp->size), - atop(mp->start), atop(mp->start+mp->size), - VM_FREELIST_DEFAULT); + atop(mp->start), atop(mp->start+mp->size), 0); } } diff --git arch/sgi/include/vmparam.h arch/sgi/include/vmparam.h index 516d855..fed2014 100644 --- arch/sgi/include/vmparam.h +++ arch/sgi/include/vmparam.h @@ -16,9 +16,6 @@ * have more than 2GB of physical memory, so this doesn't affect them. */ -#define VM_NFREELIST 2 -#define VM_FREELIST_DMA32 1 /* memory suitable for 32-bit DMA */ - #include <mips64/vmparam.h> #endif /* _MACHINE_VMPARAM_H_ */ diff --git arch/sgi/sgi/autoconf.c arch/sgi/sgi/autoconf.c index d913577..f8dd65b 100644 --- arch/sgi/sgi/autoconf.c +++ arch/sgi/sgi/autoconf.c @@ -163,8 +163,7 @@ diskconf(void) * Register a memory region. */ int -memrange_register(uint64_t startpfn, uint64_t endpfn, uint64_t bmask, - unsigned int freelist) +memrange_register(uint64_t startpfn, uint64_t endpfn, uint64_t bmask) { struct phys_mem_desc *cur, *m = NULL; int i; @@ -209,18 +208,16 @@ memrange_register(uint64_t startpfn, uint64_t endpfn, uint64_t bmask, m = cur; /* first free segment */ continue; } - /* merge contiguous areas if on the same freelist */ - if (cur->mem_freelist == freelist) { - if (cur->mem_first_page == endpfn && - ((cur->mem_last_page ^ startpfn) & bmask) == 0) { - cur->mem_first_page = startpfn; - return 0; - } - if (cur->mem_last_page == startpfn && - ((cur->mem_first_page ^ endpfn) & bmask) == 0) { - cur->mem_last_page = endpfn; - return 0; - } + /* merge contiguous areas */ + if (cur->mem_first_page == endpfn && + ((cur->mem_last_page ^ startpfn) & bmask) == 0) { + cur->mem_first_page = startpfn; + return 0; + } + if (cur->mem_last_page == startpfn && + ((cur->mem_first_page ^ endpfn) & bmask) == 0) { + cur->mem_last_page = endpfn; + return 0; } } @@ -229,7 +226,6 @@ memrange_register(uint64_t startpfn, uint64_t endpfn, uint64_t bmask, m->mem_first_page = startpfn; m->mem_last_page = endpfn; - m->mem_freelist = freelist; return 0; } diff --git arch/sgi/sgi/ip30_machdep.c arch/sgi/sgi/ip30_machdep.c index 90c6ff4..de73530 100644 --- arch/sgi/sgi/ip30_machdep.c +++ arch/sgi/sgi/ip30_machdep.c @@ -137,8 +137,7 @@ ip30_setup() * Add memory not obtained through ARCBios. */ if (start >= IP30_MEMORY_BASE + IP30_MEMORY_ARCBIOS_LIMIT) { - memrange_register(atop(start), atop(end), - 0, VM_FREELIST_DEFAULT); + memrange_register(atop(start), atop(end), 0); } } diff --git arch/sgi/sgi/ip32_machdep.c arch/sgi/sgi/ip32_machdep.c index d70fb19..3f1dfa7 100644 --- arch/sgi/sgi/ip32_machdep.c +++ arch/sgi/sgi/ip32_machdep.c @@ -98,8 +98,7 @@ crime_configure_memory(void) first_page = atop(addr); last_page = atop(addr + size); - memrange_register(first_page, last_page, 0, - VM_FREELIST_DEFAULT); + memrange_register(first_page, last_page, 0); } #ifdef DEBUG diff --git arch/sgi/sgi/machdep.c arch/sgi/sgi/machdep.c index 5a46ddb..072679a 100644 --- arch/sgi/sgi/machdep.c +++ arch/sgi/sgi/machdep.c @@ -315,7 +315,6 @@ mips_init(int argc, void *argv, caddr_t boot_esym) for (i = 0; i < MAXMEMSEGS && mem_layout[i].mem_last_page != 0; i++) { uint64_t fp, lp; uint64_t firstkernpage, lastkernpage; - unsigned int freelist; paddr_t firstkernpa, lastkernpa; if (IS_XKPHYS((vaddr_t)start)) @@ -332,14 +331,13 @@ mips_init(int argc, void *argv, caddr_t boot_esym) fp = mem_layout[i].mem_first_page; lp = mem_layout[i].mem_last_page; - freelist = mem_layout[i].mem_freelist; /* Account for kernel and kernel symbol table. */ if (fp >= firstkernpage && lp < lastkernpage) continue; /* In kernel. */ if (lp < firstkernpage || fp > lastkernpage) { - uvm_page_physload(fp, lp, fp, lp, freelist); + uvm_page_physload(fp, lp, fp, lp, 0); continue; /* Outside kernel. */ } @@ -349,11 +347,11 @@ mips_init(int argc, void *argv, caddr_t boot_esym) lp = firstkernpage; else { /* Need to split! */ uint64_t xp = firstkernpage; - uvm_page_physload(fp, xp, fp, xp, freelist); + uvm_page_physload(fp, xp, fp, xp, 0); fp = lastkernpage; } if (lp > fp) { - uvm_page_physload(fp, lp, fp, lp, freelist); + uvm_page_physload(fp, lp, fp, lp, 0); } } diff --git arch/sgi/sgi/sginode.c arch/sgi/sgi/sginode.c index b26b0df..a269475 100644 --- arch/sgi/sgi/sginode.c +++ arch/sgi/sgi/sginode.c @@ -526,9 +526,7 @@ kl_add_memory_ip27(int16_t nasid, int16_t *sizes, unsigned int cnt) } if (memrange_register(fp, lp, - ~(atop(1UL << kl_n_shift) - 1), - lp <= atop(2UL << 30) ? - VM_FREELIST_DEFAULT : VM_FREELIST_DMA32) != 0) { + ~(atop(1UL << kl_n_shift) - 1)) != 0) { /* * We could hijack the smallest segment here. * But is it really worth doing? @@ -575,9 +573,7 @@ kl_add_memory_ip35(int16_t nasid, int16_t *sizes, unsigned int cnt) } if (memrange_register(fp, lp, - ~(atop(1UL << kl_n_shift) - 1), - lp <= atop(2UL << 30) ? - VM_FREELIST_DEFAULT : VM_FREELIST_DMA32) != 0) { + ~(atop(1UL << kl_n_shift) - 1)) != 0) { /* * We could hijack the smallest segment here. * But is it really worth doing? diff --git arch/socppc/include/vmparam.h arch/socppc/include/vmparam.h index 95987bf..97429e4 100644 --- arch/socppc/include/vmparam.h +++ arch/socppc/include/vmparam.h @@ -97,9 +97,6 @@ extern vaddr_t ppc_kvm_stolen; #define VM_PHYSSEG_NOADD #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #ifdef _KERNEL #define __HAVE_VM_PAGE_MD diff --git arch/solbourne/solbourne/pmap.c arch/solbourne/solbourne/pmap.c index f693ee3..a395e67 100644 --- arch/solbourne/solbourne/pmap.c +++ arch/solbourne/solbourne/pmap.c @@ -455,17 +455,14 @@ pmap_bootstrap(size_t promdata) #endif uvm_page_physload( atop(PTW1_TO_PHYS(ekern)), prompa, - atop(PTW1_TO_PHYS(ekern)), prompa, - VM_FREELIST_DEFAULT); + atop(PTW1_TO_PHYS(ekern)), prompa, 0); uvm_page_physload( prompa + promlen, atop(PHYSMEM_BASE) + physmem, - prompa + promlen, atop(PHYSMEM_BASE) + physmem, - VM_FREELIST_DEFAULT); + prompa + promlen, atop(PHYSMEM_BASE) + physmem, 0); } else { uvm_page_physload( atop(PTW1_TO_PHYS(ekern)), atop(PHYSMEM_BASE) + physmem, - atop(PTW1_TO_PHYS(ekern)), atop(PHYSMEM_BASE) + physmem, - VM_FREELIST_DEFAULT); + atop(PTW1_TO_PHYS(ekern)), atop(PHYSMEM_BASE) + physmem, 0); } } diff --git arch/sparc/include/vmparam.h arch/sparc/include/vmparam.h index e0d39e8..52a5dc7 100644 --- arch/sparc/include/vmparam.h +++ arch/sparc/include/vmparam.h @@ -130,9 +130,6 @@ struct vm_page_md { (pg)->mdpage.pv_head.pv_flags = 0; \ } while (0) -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #if defined (_KERNEL) && !defined(_LOCORE) struct vm_map; #define dvma_mapin(map,va,len,canwait) dvma_mapin_space(map,va,len,canwait,0) diff --git arch/sparc/sparc/pmap.c arch/sparc/sparc/pmap.c index d062497..3d8a402 100644 --- arch/sparc/sparc/pmap.c +++ arch/sparc/sparc/pmap.c @@ -865,7 +865,7 @@ pmap_page_upload(void) start, chop, end); #endif uvm_page_physload(atop(start), atop(chop), - atop(start), atop(chop), VM_FREELIST_DEFAULT); + atop(start), atop(chop), 0); /* * Adjust the start address to reflect the @@ -883,7 +883,7 @@ pmap_page_upload(void) /* Upload (the rest of) this segment */ uvm_page_physload(atop(start), atop(end), - atop(start), atop(end), VM_FREELIST_DEFAULT); + atop(start), atop(end), 0); } } diff --git arch/sparc64/include/vmparam.h arch/sparc64/include/vmparam.h index 254fa31..fb056e5 100644 --- arch/sparc64/include/vmparam.h +++ arch/sparc64/include/vmparam.h @@ -115,9 +115,6 @@ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - #define __HAVE_VM_PAGE_MD /* * For each struct vm_page, there is a list of all currently valid virtual diff --git arch/sparc64/sparc64/pmap.c arch/sparc64/sparc64/pmap.c index 72c96e0..bf1b336 100644 --- arch/sparc64/sparc64/pmap.c +++ arch/sparc64/sparc64/pmap.c @@ -1235,8 +1235,7 @@ remap_data: atop(mp->start), atop(mp->start+mp->size), atop(mp->start), - atop(mp->start+mp->size), - VM_FREELIST_DEFAULT); + atop(mp->start+mp->size), 0); } #if 0 @@ -1246,8 +1245,7 @@ remap_data: uvm_page_physload(atop(ekdatap), atop(roundup(ekdatap, (4*MEG))), atop(ekdatap), - atop(roundup(ekdatap, (4*MEG))), - VM_FREELIST_DEFAULT); + atop(roundup(ekdatap, (4*MEG))), 0); } #endif diff --git arch/vax/include/vmparam.h arch/vax/include/vmparam.h index ec2c07b..9ca23a8 100644 --- arch/vax/include/vmparam.h +++ arch/vax/include/vmparam.h @@ -88,9 +88,6 @@ #define VM_PHYSSEG_NOADD #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - /* MD round macros */ #define vax_round_page(x) (((vaddr_t)(x) + VAX_PGOFSET) & ~VAX_PGOFSET) #define vax_trunc_page(x) ((vaddr_t)(x) & ~VAX_PGOFSET) diff --git arch/vax/vax/pmap.c arch/vax/vax/pmap.c index ee93472..aa637f3 100644 --- arch/vax/vax/pmap.c +++ arch/vax/vax/pmap.c @@ -257,7 +257,7 @@ pmap_bootstrap() * Now everything should be complete, start virtual memory. */ uvm_page_physload(atop(avail_start), atop(avail_end), - atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); + atop(avail_start), atop(avail_end), 0); mtpr(sysptsize, PR_SLR); rpb.sbr = mfpr(PR_SBR); rpb.slr = mfpr(PR_SLR); diff --git arch/zaurus/include/vmparam.h arch/zaurus/include/vmparam.h index 3352e71..6b74069 100644 --- arch/zaurus/include/vmparam.h +++ arch/zaurus/include/vmparam.h @@ -79,8 +79,4 @@ #endif /* _KERNEL */ -#define VM_NFREELIST 1 -#define VM_FREELIST_DEFAULT 0 - - #endif /* _MACHINE_VMPARAM_H_ */ diff --git arch/zaurus/zaurus/zaurus_machdep.c arch/zaurus/zaurus/zaurus_machdep.c index ae7e156..d5f226e 100644 --- arch/zaurus/zaurus/zaurus_machdep.c +++ arch/zaurus/zaurus/zaurus_machdep.c @@ -1090,8 +1090,7 @@ initarm(void *arg) #endif uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ uvm_page_physload(atop(physical_freestart), atop(physical_freeend), - atop(physical_freestart), atop(physical_freeend), - VM_FREELIST_DEFAULT); + atop(physical_freestart), atop(physical_freeend), 0); /* Boot strap pmap telling it where the kernel page table is */ #ifdef VERBOSE_INIT_ARM diff --git dev/pci/drm/i915_drv.c dev/pci/drm/i915_drv.c index 6fb20fe..e7990b0 100644 --- dev/pci/drm/i915_drv.c +++ dev/pci/drm/i915_drv.c @@ -489,9 +489,9 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) dev = (struct drm_device *)dev_priv->drmdev; /* XXX would be a lot nicer to get agp info before now */ - uvm_page_physload_flags(atop(dev->agp->base), atop(dev->agp->base + + uvm_page_physload(atop(dev->agp->base), atop(dev->agp->base + dev->agp->info.ai_aperture_size), atop(dev->agp->base), - atop(dev->agp->base + dev->agp->info.ai_aperture_size), 0, + atop(dev->agp->base + dev->agp->info.ai_aperture_size), PHYSLOAD_DEVICE); /* array of vm pages that physload introduced. */ dev_priv->pgs = PHYS_TO_VM_PAGE(dev->agp->base); diff --git uvm/uvm.h uvm/uvm.h index 3d79243..8417327 100644 --- uvm/uvm.h +++ uvm/uvm.h @@ -62,9 +62,6 @@ #include <uvm/uvm_swap_encrypt.h> #endif -/* - * pull in VM_NFREELIST - */ #include <machine/vmparam.h> /* diff --git uvm/uvm_extern.h uvm/uvm_extern.h index 8a90373..dda792c 100644 --- uvm/uvm_extern.h +++ uvm/uvm_extern.h @@ -673,10 +673,8 @@ void uvm_pagealloc_multi(struct uvm_object *, voff_t, void uvm_pagerealloc(struct vm_page *, struct uvm_object *, voff_t); /* Actually, uvm_page_physload takes PF#s which need their own type */ -void uvm_page_physload_flags(paddr_t, paddr_t, paddr_t, - paddr_t, int, int); -#define uvm_page_physload(s, e, as, ae, fl) \ - uvm_page_physload_flags(s, e, as, ae, fl, 0) +void uvm_page_physload(paddr_t, paddr_t, paddr_t, + paddr_t, int); void uvm_setpagesize(void); void uvm_shutdown(void); diff --git uvm/uvm_page.c uvm/uvm_page.c index 10ef7d1..e0eddfe 100644 --- uvm/uvm_page.c +++ uvm/uvm_page.c @@ -459,14 +459,11 @@ uvm_pageboot_alloc(vsize_t size) * => return false if out of memory. */ -/* subroutine: try to allocate from memory chunks on the specified freelist */ -static boolean_t uvm_page_physget_freelist(paddr_t *, int); - -static boolean_t -uvm_page_physget_freelist(paddr_t *paddrp, int freelist) +boolean_t +uvm_page_physget(paddr_t *paddrp) { int lcv, x; - UVMHIST_FUNC("uvm_page_physget_freelist"); UVMHIST_CALLED(pghist); + UVMHIST_FUNC("uvm_page_physget"); UVMHIST_CALLED(pghist); /* pass 1: try allocating from a matching end */ #if (VM_PHYSSEG_STRAT == VM_PSTRAT_BIGFIRST) || \ @@ -480,9 +477,6 @@ uvm_page_physget_freelist(paddr_t *paddrp, int freelist) if (uvm.page_init_done == TRUE) panic("uvm_page_physget: called _after_ bootstrap"); - if (vm_physmem[lcv].free_list != freelist) - continue; - /* try from front */ if (vm_physmem[lcv].avail_start == vm_physmem[lcv].start && vm_physmem[lcv].avail_start < vm_physmem[lcv].avail_end) { @@ -555,18 +549,6 @@ uvm_page_physget_freelist(paddr_t *paddrp, int freelist) return (FALSE); /* whoops! */ } -boolean_t -uvm_page_physget(paddr_t *paddrp) -{ - int i; - UVMHIST_FUNC("uvm_page_physget"); UVMHIST_CALLED(pghist); - - /* try in the order of freelist preference */ - for (i = 0; i < VM_NFREELIST; i++) - if (uvm_page_physget_freelist(paddrp, i) == TRUE) - return (TRUE); - return (FALSE); -} #endif /* PMAP_STEAL_MEMORY */ /* @@ -579,8 +561,8 @@ uvm_page_physget(paddr_t *paddrp) */ void -uvm_page_physload_flags(paddr_t start, paddr_t end, paddr_t avail_start, - paddr_t avail_end, int free_list, int flags) +uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start, + paddr_t avail_end, int flags) { int preload, lcv; psize_t npages; @@ -590,9 +572,6 @@ uvm_page_physload_flags(paddr_t start, paddr_t end, paddr_t avail_start, if (uvmexp.pagesize == 0) panic("uvm_page_physload: page size not set!"); - if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT) - panic("uvm_page_physload: bad free list %d", free_list); - if (start >= end) panic("uvm_page_physload: start >= end"); @@ -732,7 +711,6 @@ uvm_page_physload_flags(paddr_t start, paddr_t end, paddr_t avail_start, ps->pgs = pgs; ps->lastpg = pgs + npages - 1; } - ps->free_list = free_list; vm_nphysseg++; /* diff --git uvm/uvm_page.h uvm/uvm_page.h index e131424..105f1e7 100644 --- uvm/uvm_page.h +++ uvm/uvm_page.h @@ -202,7 +202,6 @@ struct vm_physseg { paddr_t end; /* (PF# of last page in segment) + 1 */ paddr_t avail_start; /* PF# of first free page in segment */ paddr_t avail_end; /* (PF# of last free page in segment) +1 */ - int free_list; /* which free list they belong on */ struct vm_page *pgs; /* vm_page structures (from start) */ struct vm_page *lastpg; /* vm_page structure for end */ #ifdef __HAVE_PMAP_PHYSSEG -- 1.7.3.5 -- Two sure ways to tell a sexy male; the first is, he has a bad memory. I forget the second.