Re: Remove the freelist member from vm_physseg
On Fri, May 13, 2011 at 11:36:48PM +0100, Owain Ainsworth wrote: On Mon, May 09, 2011 at 10:15:23PM +0100, Owain Ainsworth wrote: 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. So i have verified that this builds on: alpha amd64 armish beagle hppa hppa64 i386 landisk loongson macppc octeon palm socppc sparc sparc64 zaurus gumstix didn't pass config let alone build but that seems to be a problem in GENERIC. So that leaves only the m88k-arch, m68k-arch and vax kernels untested (and there is no way I can verify them really). Any comments? ok? Freelist death, I like. Ok. 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 @@ #defineVM_PHYSSEG_STRATVM_PSTRAT_BSEARCH #defineVM_PHYSSEG_NOADD/* no more after vm_mem_init */ -#defineVM_NFREELIST1 -#defineVM_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 = (1UL32)) - 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 */
Re: Remove the freelist member from vm_physseg
On Mon, May 09, 2011 at 10:15:23PM +0100, Owain Ainsworth wrote: 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. So i have verified that this builds on: alpha amd64 armish beagle hppa hppa64 i386 landisk loongson macppc octeon palm socppc sparc sparc64 zaurus gumstix didn't pass config let alone build but that seems to be a problem in GENERIC. So that leaves only the m88k-arch, m68k-arch and vax kernels untested (and there is no way I can verify them really). Any comments? ok? -0- 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_STRATVM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD/* no more after vm_mem_init */ -#define VM_NFREELIST1 -#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 = (1UL32)) - 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_NFREELIST3 -#define VM_FREELIST_DEFAULT 0 -#define VM_FREELIST_LOW 1 -#define
Re: Remove the freelist member from vm_physseg
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 @@ #defineVM_PHYSSEG_STRATVM_PSTRAT_BSEARCH #defineVM_PHYSSEG_NOADD/* no more after vm_mem_init */ -#defineVM_NFREELIST1 -#defineVM_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 = (1UL32)) - 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 */ -#defineVM_NFREELIST3 -#defineVM_FREELIST_DEFAULT 0 -#defineVM_FREELIST_LOW 1 -#defineVM_FREELIST_HIGH2 - #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),