Fri Jun 9 06:43:30 2017 UTC ()
Maintain the split of physical memory into the defined freelists, but
only force pool pages to VM_FREELIST_FIRST512M for non _LP64


(skrll)
diff -r1.277 -r1.278 src/sys/arch/mips/mips/mips_machdep.c

cvs diff -r1.277 -r1.278 src/sys/arch/mips/mips/mips_machdep.c (expand / switch to unified diff)

--- src/sys/arch/mips/mips/mips_machdep.c 2017/05/07 05:45:07 1.277
+++ src/sys/arch/mips/mips/mips_machdep.c 2017/06/09 06:43:30 1.278
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mips_machdep.c,v 1.277 2017/05/07 05:45:07 skrll Exp $ */ 1/* $NetBSD: mips_machdep.c,v 1.278 2017/06/09 06:43:30 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright 2002 Wasabi Systems, Inc. 4 * Copyright 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Simon Burge for Wasabi Systems, Inc. 7 * Written by Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -101,27 +101,27 @@ @@ -101,27 +101,27 @@
101 * Copyright 1996 The Board of Trustees of The Leland Stanford 101 * Copyright 1996 The Board of Trustees of The Leland Stanford
102 * Junior University. All Rights Reserved. 102 * Junior University. All Rights Reserved.
103 * 103 *
104 * Permission to use, copy, modify, and distribute this 104 * Permission to use, copy, modify, and distribute this
105 * software and its documentation for any purpose and without 105 * software and its documentation for any purpose and without
106 * fee is hereby granted, provided that the above copyright 106 * fee is hereby granted, provided that the above copyright
107 * notice appear in all copies. Stanford University 107 * notice appear in all copies. Stanford University
108 * makes no representations about the suitability of this 108 * makes no representations about the suitability of this
109 * software for any purpose. It is provided "as is" without 109 * software for any purpose. It is provided "as is" without
110 * express or implied warranty. 110 * express or implied warranty.
111 */ 111 */
112 112
113#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ 113#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
114__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.277 2017/05/07 05:45:07 skrll Exp $"); 114__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.278 2017/06/09 06:43:30 skrll Exp $");
115 115
116#define __INTR_PRIVATE 116#define __INTR_PRIVATE
117#include "opt_cputype.h" 117#include "opt_cputype.h"
118#include "opt_compat_netbsd32.h" 118#include "opt_compat_netbsd32.h"
119#include "opt_multiprocessor.h" 119#include "opt_multiprocessor.h"
120 120
121#include <sys/param.h> 121#include <sys/param.h>
122#include <sys/systm.h> 122#include <sys/systm.h>
123#include <sys/proc.h> 123#include <sys/proc.h>
124#include <sys/intr.h> 124#include <sys/intr.h>
125#include <sys/exec.h> 125#include <sys/exec.h>
126#include <sys/reboot.h> 126#include <sys/reboot.h>
127#include <sys/mount.h> /* fsid_t for syscallargs */ 127#include <sys/mount.h> /* fsid_t for syscallargs */
@@ -2094,33 +2094,34 @@ mips_page_physload(vaddr_t vkernstart, v @@ -2094,33 +2094,34 @@ mips_page_physload(vaddr_t vkernstart, v
2094 bool need512m = false; 2094 bool need512m = false;
2095#endif 2095#endif
2096#ifdef VM_FREELIST_FIRST4G 2096#ifdef VM_FREELIST_FIRST4G
2097 bool need4g = false; 2097 bool need4g = false;
2098#endif 2098#endif
2099 2099
2100 /* 2100 /*
2101 * Do a first pass and see what ranges memory we have to deal with. 2101 * Do a first pass and see what ranges memory we have to deal with.
2102 */ 2102 */
2103 for (size_t i = 0; i < nseg; i++) { 2103 for (size_t i = 0; i < nseg; i++) {
2104#ifdef VM_FREELIST_FIRST4G 2104#ifdef VM_FREELIST_FIRST4G
2105 if (round_page(segs[i].start + segs[i].size) > FOURGIG) { 2105 if (round_page(segs[i].start + segs[i].size) > FOURGIG) {
2106 need4g = true; 2106 need4g = true;
2107 mips_poolpage_vmfreelist = VM_FREELIST_FIRST4G; 
2108 } 2107 }
2109#endif 2108#endif
2110#ifdef VM_FREELIST_FIRST512M 2109#ifdef VM_FREELIST_FIRST512M
2111 if (round_page(segs[i].start + segs[i].size) > HALFGIG) { 2110 if (round_page(segs[i].start + segs[i].size) > HALFGIG) {
2112 need512m = true; 2111 need512m = true;
 2112#if !defined(_LP64)
2113 mips_poolpage_vmfreelist = VM_FREELIST_FIRST512M; 2113 mips_poolpage_vmfreelist = VM_FREELIST_FIRST512M;
 2114#endif
2114 } 2115 }
2115#endif 2116#endif
2116 } 2117 }
2117#endif /* VM_FREELIST_FIRST512M || VM_FREELIST_FIRST4G */ 2118#endif /* VM_FREELIST_FIRST512M || VM_FREELIST_FIRST4G */
2118 2119
2119 for (; nseg-- > 0; segs++) { 2120 for (; nseg-- > 0; segs++) {
2120 /* 2121 /*
2121 * Make sure everything is in page units. 2122 * Make sure everything is in page units.
2122 */ 2123 */
2123 paddr_t segstart = round_page(segs->start); 2124 paddr_t segstart = round_page(segs->start);
2124 const paddr_t segfinish = trunc_page(segs->start + segs->size); 2125 const paddr_t segfinish = trunc_page(segs->start + segs->size);
2125 2126
2126 printf("phys segment: %#"PRIxPADDR" @ %#"PRIxPADDR"\n", 2127 printf("phys segment: %#"PRIxPADDR" @ %#"PRIxPADDR"\n",